PageHeight, PageWidth

These two properties tell you the size of an individual page in a page frame. Because all pages must be the same size, they're properties of the page frame itself, not of the individual page.

Usage

nPageHeight = pgfPageFrame.PageHeight
nPageWidth = pgfPageFrame.PageWidth
As the syntax indicates, these are read-only properties. They're a function of the Height and Width of the page frame. In addition, PageHeight is affected by the presence or absence of tabs. In VFP 3, changes to BorderWidth (which matter only when Tabs is .F.) have a delayed reaction in the Form Designer—you don't see them reflected in PageHeight until you set Tabs to .T., then set it back to .F. or close and reopen the form. As far as we can tell, changes to BorderWidth at runtime don't change PageHeight at all. Similarly, PageWidth isn't affected by BorderWidth under any circumstances. In VFP 5 and later versions, both PageWidth and PageHeight are affected by changes to BorderWidth, both at design-time and runtime. The value of these properties is always given in the current ScaleMode for the containing form. In the default pixels, our tests show that PageWidth is Width - 2*(BorderWidth+1). With no tabs, PageHeight is Height - 2*(BorderWidth+1). With unstacked tabs, it appears that PageHeight is always 30 pixels less than Height. Stacking the tabs changes Height, but PageHeight stays the same as with unstacked tabs.

Example

IF This.PageWidth>200
  * add something
  This.AddObject("NewButton", "CommandButton")
  * now set it up appropriately
ENDIF

See Also

BorderWidth, Height, Page, PageFrame, ScaleMode, Tabs, TabStretch, Width


Back to Table of Contents

Copyright © 2002-2018 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. Click for license .