Results 1 to 3 of 3

Thread: 3 Lists

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Location
    California
    Posts
    115

    Post

    The best solution I can think of is to have 3 list boxes. One that has names, one that has urls, and the 3rd to move all the highlighted items in list two and add them to list3

    So, I guess my questions would be,

    A). How can I get list2 to select all the same things as list1, for example:

    If I clicked on List1.list(0), List1.list(4), List1.list(6) it would highlight those on list2 as well.

    B). Move all the selected items on list2 to List3.

    I know this might be asking alot, but code would help.

    Thanks so much...

  2. #2
    Lively Member Ishamel's Avatar
    Join Date
    Nov 1999
    Location
    Edinburgh, Scotland
    Posts
    112

    Post

    When an item is selected in List1, this will select the corresponding item in List2. (You'll probably need a bit more code to handle mutli-selecting, but it might point you in the right direction)

    Code:
    Private Sub List1_Click()
        List2.Selected(List1.ListIndex) = True
    End Sub
    This will copy all the selected items in List2 into List3

    Code:
    Dim iTurns As Integer
        
    For iTurns = 0 To List2.ListCount - 1
        If List2.Selected(iTurns) Then List3.AddItem List2.List(iTurns)
    Next
    ------------------
    Ishamel
    KBurt59082@AOL.COM



    [This message has been edited by Ishamel (edited 12-10-1999).]

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Ishamel is right, but his code has a little glitch. Once you select the Item in the List1, it will select the same Item in the List2, but if you unselect your item, List2 woun't unselect the corresponding item.
    Change the List1 click event to this:

    Code:
    Private Sub List1_Click()
        List2.Selected(List1.ListIndex) = List1.Selected(List1.ListIndex)
    End Sub
    ------------------

    Serge

    Software Developer
    Serge_Dymkov@vertexinc.com
    Access8484@aol.com
    ICQ#: 51055819


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