|
-
May 14th, 2006, 05:17 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Syncronising 2 list boxes
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?
-
May 14th, 2006, 05:25 AM
#2
Re: Syncronising 2 list boxes
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.
-
May 14th, 2006, 05:30 AM
#3
Thread Starter
Addicted Member
Re: Syncronising 2 list boxes
no, it isn't and i tried the bottom one but it came up with an error:
Can't assign to read only property.
-
May 14th, 2006, 05:33 AM
#4
Re: Syncronising 2 list boxes
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.
-
May 14th, 2006, 06:06 AM
#5
Thread Starter
Addicted Member
Re: Syncronising 2 list boxes
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?
-
May 14th, 2006, 06:08 AM
#6
Re: Syncronising 2 list boxes
 Originally Posted by ahpro
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 
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|