Control Reference > VSPrinter Control > VSPrinter Methods > GetMargins Method |
Returns the printable area, excluding margins, in the X1, Y1, X2, and Y2 properties.
[form!]VSPrinter.GetMargins
This method provides a convenient way to determine the rectangle defined by the current page size, margins, and current column.
For example, to draw a line across the page (from margin to margin), you could use code such as:
vp.X1 = vp.MarginLeft
vp.X2 = vp.PageWidth - vp.MarginRight
vp.DrawLine vp.X1, y, vp.X2, y
Or you could use the GetMargins method and write:
vp.GetMargins
vp.DrawLine vp.X1, y, vp.X2, y
The second version is more efficient and concise, and it also works when the Columns property is set to a value greater than one.