Link to home
Start Free TrialLog in
Avatar of CipherIS
CipherISFlag for United States of America

asked on

VB.NET Get Selected Indexes of ListBox on MultiSelection

How do you loop through and get the index of the listbox of each item selected?  Haven't found a clear example.  All examples I've found get me the text and I want the numerical value as I need to pass that to an array to pull some value.
ASKER CERTIFIED SOLUTION
Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CipherIS

ASKER

That link helped which got me to this

 For Each Index In ListBox1.SelectedIndices
            TextBox2.Text &= Index.ToString() & " "
Next

Open in new window


I found it at this link
http://www.java2s.com/Tutorial/VB/0260__GUI/GetselectedindicesinaListBox.htm