Results 1 to 2 of 2

Thread: ListBox to ListBox Control

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    1

    Question ListBox to ListBox Control

    Hey

    I'm currently a college student taking Computer Programming and VB is my weak subject.
    I'm making a User Control for a ListBox to Listbox control, like the listboxes in the User Control Wizard when you choose the Properties, etc. I've got a text box to add to the left list and I want to be able to move selected items to the right list.

    I have 4 VB books and none of the are any help!

    I'd appreciate any suggestions. I'm stuck.

    Thanks
    toodles,

    Angel

  2. #2
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796
    Something like this:
    VB Code:
    1. Private Sub Command1_Click()
    2.    Dim strItem As String
    3.  
    4.    If ListBox1.ListIndex > -1 then
    5.       strItem = ListBox1.List(ListBox1.ListIndex)
    6.       ListBox1.Remove ListBox1.ListIndex
    7.       ListBox2.AddItem strItem
    8.    End If
    9.  
    10. End Sub
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

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