List box and Scroll Bar

I have 2 list boxes each contains 20 items. Both list boxes show 5 items and display a vertitcal scroll bar.  

Items from both list are corresponding to each other.  Therefore, I want to create a scroll bar so that when I scroll, both list boxes will scroll.
Of course, I aslo want to disable the default scroll-bars of those 2 listboxes

Anyone has any ideas how to do this?

Thanks in advance.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Try this example:

1) Add 2 listboxes to a new form and size them both so that about 5 items or so would be visible in the list.  Also make them the same size.

2) Paste this code into the Declarations Section of the form and run the program... Scroll either listbox.



Private Sub Form_Load()
For i = 1 To 25
    List1.AddItem "ITEM A" + CStr(i)
    List2.AddItem "ITEM B" + CStr(i)
Next i
End Sub
Private Sub List1_Scroll()
        List2.TopIndex = List1.TopIndex
End Sub
Private Sub List2_Scroll()
    List1.TopIndex = List2.TopIndex
End Sub
By the way, if your listboxes are side by side, you can just overlap the right scrollbox over the left scrollbox so that it covers the left scrollboxe's scrollbar... the right scrollbar will scroll both...


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cdlovesAuthor Commented:
Thanks a lot mcrider.  
You're welcome... Thanks for the points!

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.