_WINDOWS

ViewPortLeft, ViewPortTop

These two properties tell you what part of a form is currently visible. Well, actually, they tell you where the visible part starts—you need to combine them with some others to figure out the whole visible portion.

Usage

nVisibleLeft = frmForm.ViewPortLeft nVisibleTop = frmForm.ViewPortTop
For a form with scrollbars, you sometimes need to know which part of the form the user can see at this moment. These two get you started by telling you the upper-left corner of the part you can see. Add Height and Width to these to see where the visible area ends.

You can't set these directly. To change the position of the viewport, call the SetViewPort method.

Example

* A control can figure out whether it can be seen IF NOT BETWEEN(This.Left,ThisForm.ViewPortLeft, ;                ThisForm.ViewPortLeft + ThisForm.Width)    * Hmmm, I can't be seen. What should I do?    * I know. I'll be obnoxious!    MESSAGEBOX("Hey, you can't see me! Try scrolling.", 64, ;               This.Name) ENDIF

See Also

Form, Height, SetViewPort, ViewPortHeight, ViewPortWidth, Width


View Updates

Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.



Hacker's Guide to Visual FoxPro 7. 0
Hackers Guide to Visual FoxPro 7.0
ISBN: 1930919220
EAN: 2147483647
Year: 2001
Pages: 899

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net