Solved

VB.NET Get Selected Indexes of ListBox on MultiSelection

Posted on 2015-02-07
2
187 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
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…

837 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