Link to home
Start Free TrialLog in
Avatar of MonteCristo33
MonteCristo33

asked on

How to make two vertical scroll bars behave identically on a form.

Hi Experts,
I have two vertical scroll bars on my form and I would like the second scroll bar to replicate everything the 1st one does and vice versa. In other words, if I scroll down on the 1st scroll bar, the cursor on the 2nd scroll bar should follow and stop at the exact same position, and conversely.

I tried the .scroll event handling the two scrollbars in the same sub, but that did not work.

Any suggestions? Is it even feasible?

Many thanks in anticipation.

MC
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Yes it's feasible...just to clarify though...you are MANUALLY placing scrollbars on your form right?
(not using an AutoScroll on a container).
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MonteCristo33
MonteCristo33

ASKER

Dear Idle Mind,

Thanks for your contribution. I have manually added the 2 scroll bars to my form. I assume the code above will work with the scrollbars manually added. Let me try and I'll get back to you.

MC
It worked for me in VB.Net 2008.  I added two VScrollBars to my form (VScrollBar1 & VScrollBar2).

I tested it with about ten scrollbars at the same time just to make it sure worked though...  =)
Another great one from Idle Mind.
Thanks!