Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form with horizantal scroll bar - VFP8

Status
Not open for further replies.

kmagy

MIS
Oct 21, 2003
38
JO
Hi every body

When a form with horizantal scroll bar and its orientation is right to left activates it shows the left area, and the scroll bar is from left to right, How can I show the form Right area and a right to left scroll bar

Thanks in advance
 
kmagy,

If you have a form that has scrollbars on it, the area you can see in the form is known as it's viewport. And since a form doesn't give us a DoScroll event we must set the ViewPortLeft and ViewPortTop properties. These properties are listed as read-only in the helpfile, but this is only partly true. They just can't be set directly, we are fortunate that a method for setting these has been provided called SetViewPort...

Code:
*!* 10000 is much bigger than needed insuring we end up completely to the right

thisform.SetViewPort(10000, thisform.ViewPortTop)


...the preceding code will put the viewport as far to the left as possible...which simulates scrolling the form's viewport all the way to the right. Put this code in the Form's Init or in some other event that occurs after the form has intialized and you have set the form's viewport.


boyd.gif

[sub]craig1442@mchsi.com[/sub][sup]
"Whom computers would destroy, they must first drive mad." - Anon​
[/sup]
 
craigsboyd said:
the preceding code will put the viewport as far to the left as possible

Should Read: the preceding code will put the viewport as far to the right as possible

boyd.gif

[sub]craig1442@mchsi.com[/sub][sup]
"Whom computers would destroy, they must first drive mad." - Anon​
[/sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top