Reputation: 60711
how do i make it say that on form load, the first item in the listbox is selected?
Upvotes: 4
Views: 24139
Reputation:
Hi you can use the SelectedIndex Property of listbox for eg.
listbox1.selectedindex = 0
Upvotes: 5
Reputation: 10681
Using of the selected indix is the best way - listbox1.selectedindex = 0 (since it is a 0 based collection)
Upvotes: 4
Reputation: 2839
As far as I know the first item is always selected if no other item is assigned to be. If you want to reset it back to the first item to be selected, a better approach in my opinion is:
listbox1.ClearSelection()
Upvotes: 0