PDA

Click to See Complete Forum and Search --> : 3 Lists


Ryan
Dec 9th, 1999, 09:57 PM
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...

Ishamel
Dec 9th, 1999, 10:11 PM
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)


Private Sub List1_Click()
List2.Selected(List1.ListIndex) = True
End Sub


This will copy all the selected items in List2 into List3


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).]

Serge
Dec 9th, 1999, 10:18 PM
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:


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 (http://www.icq.com/51055819)