Click to See Complete Forum and Search --> : ListBox problem


AndyK
May 14th, 2001, 12:58 AM
Hi,
say if List1.List(x) is "Hello", then how to select the "Hello" in List1. By saying "Select", I mean to highlight the line "Hello" in List1. I could use List1.Text = "Hello", but what if there are multiple "Hello" lines, and I want to select all of them.

Thank You

udipr
May 14th, 2001, 06:08 AM
Very simple.

write this line:

List1.ListIndex = x 'x=number of the element to be selected

John G Duffy
May 14th, 2001, 01:06 PM
private Sub Command1_Click()
' List1.MultiSelect = true ' assign at Design time
List1.Selected(2) = true
List1.Selected(4) = true

End Sub




John G