How would i syncronise 2 list boxes so that if (for example) i click the top option in 1 of them then the top value will be selected in the other one and if i click the 4th one the 4th one will be selected in the other one aswell?
Printable View
How would i syncronise 2 list boxes so that if (for example) i click the top option in 1 of them then the top value will be selected in the other one and if i click the 4th one the 4th one will be selected in the other one aswell?
Is this with multiselect on? If so:VB Code:
Private Sub List1_Click() Dim N As Long For N = 0 To List1.ListCount - 1 List2.Selected(N) = List1.Selected(N) Next N List2.TopIndex = List1.TopIndex End Sub
If not, then just set the List2.ListIndex = List1.ListIndex in the click event.
no, it isn't and i tried the bottom one but it came up with an error:
Can't assign to read only property.
hmmm, i didn't get that error, but it didn't work anyway (that's what you get for not checking code before you post it). In that case just use the first code i posted. It will work.
lol, you've helped me so much it says i can't give you any more reputation point thingys until i give some to other people so i'm gonna make sure i've given everyone who's helped some before i get to giving you more ok?
No Worries :DQuote:
Originally Posted by ahpro
Check out this link if you want more info about how reps work: http://www.vbforums.com/faq.php?faq=...putation_group
Don't forget to mark this thread resolved :thumb: