Problem with Multis Selct ListBox on Remove...

Posted on 2005-04-22
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 85

    Accepted Solution

    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Suggested Solutions

    Title # Comments Views Activity
    Get rid of selecting hard-coded cell 8 53
    Disable & as shortcut in label 3 26
    How to parse date from file path? 4 31
    Wordmerge 8 32
    This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now