Results 1 to 2 of 2

Thread: Listbox (Moving Items to another listbox)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2002
    Posts
    159

    Listbox (Moving Items to another listbox)

    Hey I’m trying to move multiple items from one listbox to another and vice versa but with my code now it only moves one at a time

    Here is my code:


    Code:
            ListBox2.Items.Add(ListBox1.SelectedItem)
            ListBox1.Items.Remove(ListBox1.SelectedItem)
            Button3.Enabled = False
            Button5.Enabled = False
    any suggestions would be grateful

  2. #2
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    your gonna have to do some processor work if you want them both at once, but my guess would be

    VB Code:
    1. ListBox2.Items.AddItem(ListBox1.Items(SomeItem)): ListBox1.Items(SomeItem).Remove

    And then you could take a loop from there.
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width