Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    15

    Post Unanswered: List Box / Combo Box

    I have a listbox with than 10 items and it is multiselect enabled. I want to create a function to autoselect/highlight 4 of the items in the listbox. How can this be done?thanks for any advice

  2. #2
    Join Date
    Feb 2004
    Posts
    137
    The following example selects the first four entries on a list box named ListBox:
    Code:
    Me.ListBox.Selected(0) = True
    Me.ListBox.Selected(1) = True
    Me.ListBox.Selected(2) = True
    Me.ListBox.Selected(3) = True

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Make a global Function


    Public Function HiLightListBox(objListBox as Obj, ItemsNum)
    Dim i as Byte

    For i= 1 to ItemsNum
    objListBox.Selected(i) = True
    Next
    End Function

    Calling

    HiLightListBox( Me.YourListListBoxName, 4)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •