Draws lines and rectangles on an object.
Object.Line ( fX1, fY1, fX2, fY2, clr )
The Line method syntax has the following parts:
Name |
Type |
Description |
Object |
AForm |
AForm object |
fX1 |
Val Variant |
The X coordinate of the starting point for the line or rectangle. The ScaleMode property determines the unit of measure used. If omitted, the line begins at the position indicated by CurrentX. |
fY1 |
Val Variant |
The Y coordinate of the starting point for the line or rectangle. The ScaleMode property determines the unit of measure used. If omitted, the line begins at the position indicated by CurrentY. |
fX2 |
Val Float |
The X coordinate of the end point for the line being drawn. |
fY2 |
Val Float |
The Y coordinate of the end point for the line being drawn. |
clr |
Val Variant |
Long integer value indicating the RGB color of the circle's outline. If omitted, the value of the ForeColor property is used. The RGB function or QBColor function can be used to specify the color. |
To draw connected lines, begin a subsequent line at the end point of the previous line.
The width of the line drawn depends on the setting of the DrawWidth property. The way a line or box is drawn on the background depends on the setting of the DrawMode and DrawStyle properties.
When Line executes, the CurrentX and CurrentY properties are set to the end point specified by the arguments.
The method is not applicable for MDI Form type since drawing functions are not supported for MDI Forms.
The following statements draw a line on the AForm starting relative to the CurrentX and CurrentY values, at x1=50 units, y1=60 units, and ending at x2=70 and y2=80, the line drawn in green:
frm1.Line(50,60,70,80,aclrGreen)
for i=0 to 10
Line(i*20, 10,i*20+10, 10)
next
CurrentX, CurrentY, DrawMode, DrawStyle, DrawWidth, ScaleMode