Setting the selected item of a listbox when only one the text value

  • Thread starter Thread starter ChunkyMonkey
  • Start date Start date
C

ChunkyMonkey

Hi,

As simple as I am sure this is, I am not able to get something the work.

I have a text value (string), and I want to find an item in a listbox where
the item matches the string I have, and then set that item as the selected
item.

How is this done ?


Thanks!!
 
Dim item As Integer = ListBox1.FindString(string)
ListBox1.SelectedIndex = item

where 'string' is the string you want to find.

Rob
 
Dim item As Integer = ListBox1.FindString(string)
ListBox1.SelectedIndex = item

where 'string' is the string you want to find.

Rob
 
Back
Top