Question Scroll Form to Top

ucp8

Active member
Joined
Feb 9, 2009
Messages
28
Programming Experience
3-5
Hi,

In my project I am create a form which has a scroll bar. When the form loads, it is scrolled to the bottom of the form. I want it to appear at the top of the form so the user can see the information at the beginning, rather than having to scroll up to see the tiop of the form.

I have tried using focus() on the header label and this piece of code, but neitehr have worked:

VB.NET:
Me.VerticalScroll.Value = 0

Can anyone tell me how to get a form to scroll to the top?
 
It auto scrolls to active input control. Set TabIndex to 0 for the first input control. If the top control is not an input control you can select it still with the Select method. Calling HeaderLabel.Select() in Load event handler for example, but as long as first input control is fully visible without scrolling no scrolling will take place (so you don't need to first select a Label then a TextBox for instance).
 
Back
Top