ListView
returns collections of selected items and indices through the SelectedItems
and SelectedIndices
properties. Note that these collections are empty, if no item is currently selected (lst.SelectedItems.Count = 0
). The first item that is selected is lst.SelectedItems(0)
. The index of this item in the Items
collection is lst.SelectedIndices(0)
. So basically
lst.SelectedItems(0)
is the same as
lst.Items(lst.SelectedIndices(0))
You can also use check boxes. Set CheckBoxes
to True
for this. Through the CheckedItems
and CheckedIndices
properties you can see which items are checked.