Select ListboxItem [solved]
Code:
Dim val As Integer = 0
val = ListBox1.Items.Count
ListBox1.SelectedItem = val
Im using that code . . . But, It doesnt work , I want to select the last item of the listbox using a variable to later modifie it.
thanks
You can select the last item by doing ListBox1.Items.Count - 1.
Use the "SelectedIndex" property to change which item is selected. Indices start at 0 and go to the size of the collection - 1.