Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Anyone know how to move several list box sliders the same amount when any one of the sliders is moved? I want to be sure that info shown in list box 1 is positionally related to the same entries in list box 2 and list box 3.

I have 3 list boxes each entry in the boxes contains information related to a single entry in a database. When a slider is moved in one of the boxes, I need to move the entries in the other two boxes the same amount so that the three items occupy the same apparent position in all three list boxes as the data in the moved box now occupies.

So, if I move the slider in list box 1 so that entry 17 is the top item displayed, List boxes 2 and 3 will also be moved so that entry 17 is also the top item displayed. Same goes if I move slider on either of the other two list boxes.
Posted
Updated 21-May-12 10:25am
v3
Comments
Maciej Los 21-May-12 15:42pm    
The question is not clear. Please, be more specific, place some example.
ledtech3 21-May-12 21:46pm    
I'm not sure why you would want to do it but you may be able to tie them all to a index value with some on change event handlers for the sliders and index values.

1 solution

In the Listbox subroutines there is a subroutine for 'SCROLL'. Using the following code this can be accomplished easily.

VB
Private Sub LisBx1_scroll()

  Dim X as integer

  X = LisBx1.TopIndex
  LisBx2.TopIndex = X
  LisBx3.TopIndex = X

End SUB


Do the same for the other two Listboxes.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900