How to populate a listbox with items from another listbox ( items will be selected by double clicking)

Posted on 2006-05-01
Last Modified: 2010-04-23
I have two listboxes side by side and one that is on my left has bunch of items and one that is on my right is empty.
User will select items from left by double clicking on the item and the item should disappear from left and will be populated on right.
Question by:s_more
    LVL 52

    Accepted Solution

    How about something like:

        Private Sub ListBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick

            If Not ListBox1.SelectedItem Is Nothing Then
            End If

        End Sub
    LVL 5

    Expert Comment

    in the OnDoubleClick method of the left listbox put the following:


    lstRight is name of right list box
    lstLeft is name of left list box

    this is pseudo-code but it may work

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Article by: jpaulino
    XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String ( Literal, only instead of starting and ending with w…
    Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    761 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

    8 Experts available now in Live!

    Get 1:1 Help Now