I've seen quite a number of forums posts asking how to get the selected items of a listbox when the listbox selection mode has been changed to allow for multiple items to be selected. It's actually pretty simple to do in .net.
What you need to do is to loop through the SelectedItems collection to get to the items that have been selected. The list box also has a property called SelectedIndices that you can use.
Download the zip file to see the sample code on this which also shows you how to add a name-value pair item like we used to do in VB6.
Tuesday, June 26, 2007
ListBox - Select Multiple Items
Labels:
ComboBox,
Controls,
ListBox,
VB,
VB.net,
Visual Basic,
Visual Basic.net,
Windows
Subscribe to:
Post Comments (Atom)
1 comment:
This is very inspiring work you have created for us. Some people need to know that these things can ensue to anyone. You have shown me a better view now.
Post a Comment