Solved

VB.NET Get Selected Indexes of ListBox on MultiSelection

Posted on 2015-02-07
2
185 Views
Last Modified: 2015-02-07
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.
0
Comment
Question by:CipherIS
2 Comments
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 500 total points
ID: 40596348
If  you require this task for a Win form App, you can use: listbox's selectedindices property.
then you can convert this collection property to an integer array or use it directly.
0
 
LVL 1

Author Comment

by:CipherIS
ID: 40596368
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
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Crystal reports vb.net 2 41
VB.Net - TypeInitializer Error 25 28
in Dot net,lastest version of MVC 3 25
SQL LINE CONTINUATION ISSUE 12 33
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question