>Hi there
>
>I have a form which has lot many fields for which I have to include a vertical scroll bar in the form
>There is a slight problem : When I am on the second last field the last field on the form is not visible to me can I write some piece of code for which when I loose the focus from the second field and jump to the last field the form should automatically scroll without clicking the scroll bar with mouse.
>
>Any suggestions in this regard will be highly appreciated.
>
>Thanx in advance
>Shaheer Shamsi
Shaheer, in VFP6 form.SetViewPort() method controls left and top coordinates of the visible part of form.
You can put
thisform.SetViewPort(1, newTopPosition)
into textbox2.LostFocus()
Give newTopPosition the value which allows you to see the last field.
Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison