Advertisement

06.05.2008 at 09:27AM PDT, ID: 23460876
[x]
Attachment Details

Loading items from a list separated by vbcr into a mnu is there a way to see if there is only one item?

Asked by eneate in Visual Basic Programming

Tags: visual basic

Hi

I am passed a text string from a dll which I split with vbcr, I know if no values are present but is there a way tell if there is only one.

Here is the code I use

Dim input_d As Variant
    Dim i As Integer
    Dim indexctr As String
   
    On Error GoTo errhand
   
    'load the index list for the camera list

    tempstring = mgr.DataSources(sourceTypes_camera)
    input_d = Split(tempstring, vbCr)
   
     If Not IsNull(tempstring) Then
   
          'unload the camera menu

    frm_toolbar.mnusources(0).Visible = True
    For i = frm_toolbar.mnusources.count - 1 To 1 Step -1
        Unload frm_toolbar.mnusources(i)
    Next
   
    frm_toolbar.mnusources(0).Visible = True ' ensure at least one visible menu item to allow deletions
   
    For i = LBound(input_d) To UBound(input_d)
   
    frm_toolbar.mnusources(frm_toolbar.mnusources.UBound).Caption = input_d(i)
    Load frm_toolbar.mnusources(frm_toolbar.mnusources.UBound + 1)
   
    Next i
   
  frm_toolbar.mnusources(0).Visible = False 'to ensure the first entry is not repeated in the list
 
  If frm_toolbar.Label3.Caption = text(4054) Then
  frm_toolbar.Label3.Caption = frm_toolbar.mnusources(0).Caption
  End If
 
  load_camera_presets = True

Any help would be great

thanksStart Free Trial
 
 
[+][-]06.05.2008 at 10:11AM PDT, ID: 21721755

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 10:15AM PDT, ID: 21721794

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Visual Basic Programming
Tags: visual basic
Sign Up Now!
Solution Provided By: GrahamSkan
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628