Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Aug 2001
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Removing an Item from ListBox (2000)

    Hello all, I'm trying to make one of those interfaces where there are two list boxes and you move items back and forth between the list boxes using left and right arrows.

    So basically, I select an item from the list box on the left. I click the right arrow, and it should appear on the right listbox. The value should be removed from the left listbox.

    I can get the value to appear in the right list box, but it deletes the wrong item from the source list box. Here's my code:

    <pre>
    SourceListBox.RemoveItem (Me.SourceListBox.ListIndex)

    DestinationListBox.AddItem Me.SourceListBox.Value

    MyForm.Repaint
    </pre>


  2. #2
    Star Lounger
    Join Date
    Aug 2001
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Removing an Item from ListBox (2000)

    Loungers, nevermind. In a fit of fatigue I failed to realize that if I removed the item from the source listbox, the indexes would all be changed. I just switched the order of operations to Add to Dest, Delete from Source and it's fine.

Posting Permissions

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