Select Specific ListBox Item

If you don't know the exact index number in the list of listbox items (listbox1.selectedindex=x), then you can find an item and select it by using the Value of the item: ListBox1.Items.FindByValue(MyValue).Selected = true If you don't know theValue of the item, but you know the text, you can find and select the item using the Text of the item: ListBox1.Items.FindByText("TextYouAreLookingFor").Selected = true

No comments:

Post a Comment