how to access multiple elements selected in listbox in vb.net
i have set selection mode to multiExtended in vb.net So i am able to select multiple elements but how to access those selected values/indice开发者_JS百科s using SelectedItems property?
SelectedItems
gives you a SelectedObjectCollection
which you could go through using simple indices such as:
mySelectList.SelectedItems[0]
would give you the first selected item.
You use the SelectedItems
property. Since it is an IEnumerable
you can use for-each constructs to iterate the list.
精彩评论