_UNIX

ViewPortHeight, ViewPortWidth

These properties tell you the dimensions of the visible portion of a form. They're really only relevant when the form has scrollbars.

Usage

nVisibleHeight = frmForm.ViewPortHeight nVisibleWidth = frmForm.ViewPortWidth
When a form has scrollbars, some portion of it is hidden. (We almost said "may be hidden," but the way scrollbars work, they only appear if a portion of the form is actually hidden.) These two properties let you know the size of the part of the form the user can see.

Although the "inside area" of the form accounts for a title bar, if there is one, it doesn't consider scrollbars. So, if you resize a form vertically and make a scrollbar appear, ViewPortWidth doesn't change, even though less of the actual form is now visible to the user. Oddly, Height and Width, which we'd expect to include every little bit of real estate occupied by the form, do consider both a title bar and scrollbars. So, the Height of a form can be less than its ViewPortHeight. Weird.


Example

IF This.ViewPortWidth > nSomeMagicValue    * There's enough room to do something special    This.oleGreatPicture.Visible = .T. ENDIF

See Also

Form, Height, ViewPortLeft, ViewPortTop, 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