Line
The Line control lets you draw lines wherever you want on a form, but it does appear strange at large widths. This is a full partner in the event loop, with its own properties, events and methods.
Property |
Value |
Purpose |
Numeric |
The width of the line drawn, in pixels. Note that lines with a BorderWidth of 6 or more start to take on an oblong shape. |
|
"\" |
Line slants from the upper left to lower right corner. |
|
"/" |
Line slants from the upper right to lower left corner. |
Don't assume the Width of a Line control is its actual width, nor that the control's Height is its real height. BorderWidth plays a tricky part here. Visual FoxPro attempts to create a line of width BorderWidth by drawing half the thickness above the line and half below, a reasonable algorithm. But this principle is taken too far, including the endpoints, creating a half-circle of one half of the BorderWidth around each. This is not only ugly, but inconsistent with other controls whose visual appearance is cropped at the rectangle described by their Top, Left, Height and Width properties. |
Line events fire whenever the specified action (MouseOver, Click, whatever) occurs over the defining rectangle, not just over the line. |
Example |
* A simple line control on a form, showing the oblong shape. oForm = CREATEOBJECT("form") oForm.Show() oForm.AddObject("linMine", "Line") WITH oForm.LinMine .Top = 30 .Left = 30 .BorderWidth = 20 .Height = 0 .Visible = .T. ENDWITH |
See Also |