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 |
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 |