Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

Margin

This property of all the text-based controls lets you specify a margin that’s left empty around the inside of the input area.

Usage

oObject.Margin = nMarginInPixels
nMarginInPixels = oObject.Margin

Note that the margin is measured in pixels regardless of the form’s ScaleMode. Not so unreasonable, since we can’t imagine wanting a margin large enough to measure in foxels.

The margin goes around all four sides of the input area. It’s the part that doesn’t get highlighted when you select all the text in the control.

Be careful not to make the margin too big. The control’s contents disappear with no warning if the margin covers the entire area. (Keep in mind that you’re actually getting twice as many pixels as you specify in each dimension, since the margin applies at both top and bottom and both right and left.)

Example

MyForm.edtNotes.Margin = 4

See Also

BorderWidth, ComboBox, EditBox, ScaleMode, Spinner, TextBox