Problem with Multis Selct ListBox on Remove...

Posted on 2005-04-22
Medium Priority
Last Modified: 2011-09-20
Me below code runs on lstListBox1_DoubleClick1 it's job is to move items from List one over to list 2
and then remove them from List1 so the user can not double select them. On a single select this code
works fine but if i do this with a multi select it trows an error saying "index is outside of the Bounds"
If i disable the remove command the code works fine

Dim i As Int32
        For i = 0 To lstListBox1.SelectedItems.Count - 1

Question by:AlexPonnath
1 Comment
LVL 86

Accepted Solution

Mike Tomlinson earned 2000 total points
ID: 13848224
How about:

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        While lstListBox1.SelectedItems.Count > 0
        End While
    End Sub

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month14 days, 19 hours left to enroll

840 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