Adjust Scrollbar

BlueJay924

Well-known member
Joined
May 6, 2003
Messages
46
Does anyone know adjust the scrollbar once a form has been moved? For example, i have a form that is kind of long, and what i want to do is when i reach a certain textbox, i want the form to shift up some. My code is something like: on enter do

Me.Location = New Point(40, -136)

This works part works fine. My form is shifted up, but the scrollbar remains the same until the mouse moves over it. Once i come in contact with the scrollbar its in the correct position. Does anyone know how to modify it so that it automatically moves when i change the location? Oh, and im creating an mdi application.
 
I think the easiest way would be to use the SelectedText property of the text box setting it to 0,0. I think that is how it goes. It has been a while. Try that, it may or may not work. But it is worth a shot.
 
Ive tried SelectedText and the various methods, but it just doesnt seem to work. The scrollbar still stays in the exact position until i put the mouse over it, then it moves lower.
 
Ive tried it and still nothing. Im sure its something simple but its just not happening for me. My form shifts up when i enter a text box, just like i want it to, but the scrollbar doesnt move, making it look like the user cant go to the top of the form.

Heres my code

Private Sub PhoneFlex_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles PhoneFlex.Enter

Me.Location = New Point(40, -136)

End Sub
 
Back
Top