The default choice for the list?

how to make him say that when loading the form the first element in the list is selected?

+3
source share
3 answers

Hi, you can use the SelectedIndex property for a list, for example.

listbox1.selectedindex = 0

+4
source

Using the selected index is the best way - listbox1.selectedindex = 0 (since this is a collection based on 0)

+3
source

As far as I know, the first item is always selected unless another item is assigned. If you want to reset back to the first element to be selected, the best approach, in my opinion, is this:

listbox1.ClearSelection()
0
source

Source: https://habr.com/ru/post/1710178/


All Articles