View Full Version : Scroll to horizontal end?


Rosebud
03-29-2001, 10:34 AM
Hi. Does anyone know how to (when form opens) force the horizontal scroll bar to scroll all the way to right of a form?
I know I can use the gotocontrol or setfocus for a control that could be all the way on the right side of the form, but I have a subform that comes out a little farther than the "most right" control on the main form. This causes the scroll to go almost to the end, but not quite all the way.
Also, I don't want to move any controls to the very very end of the form because it would alter the design of the form.

???


[This message has been edited by Rosebud (edited 03-29-2001).]

llkhoutx
03-29-2001, 12:39 PM
Your setfocus is the correct way to accomplish what you want. Just setfocus at the appropriate time.

Keith P
03-29-2001, 02:38 PM
I achieve a similar thing for the horizontal scroll bar using the same approach as you have described. I hide the control by using the same back and fore color as the form. On the control's on enter event I set the focus to a control further up the form for presentation purpose.
I hope this makes sense!

Rosebud
03-30-2001, 06:28 AM
Thanks Keith, you hit the nail on the head! Worked perfectly!