Link to home
Start Free TrialLog in
Avatar of truc0011
truc0011

asked on

visual basic scroll bar question

How do I add a scroll bar to a form?  To just scroll up and down the form in case of data not being displayed on the screen?
Avatar of cparlanti
cparlanti

The best thing you can do is draw in your form some kind of container (a flat picture box would do) and the draw all your controls as part of the container.

Add a vertical scroll bar (VScrollBar).

In the change event of the vertical scroll bar you can retrieve the value property of the scroll bar itself and change the top property of the picture box (moving the control and all the objects with it).

You're also gonna need to write some code in the form_resize event to keep the scroll bar to the right of the form with the same heigth of form.scaleheigth.
ASKER CERTIFIED SOLUTION
Avatar of dennislw
dennislw

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 truc0011

ASKER

Great help!
Thanks