|
Description
|
Shows the distance specified by the X1, Y1, X2 and Y2 parameters. as a dashed line.
|
|
Syntax
|
[form.]DXFReader.ShowRubberLine (X1 As Single, Y1 As Single, X2 As Single, Y2 As Single)
|
|
Remarks
|
This method is usually called from the MouseMove event to provide feedback to the user while drawing a line or selecting a linear distance as a rubber-band line.
To show how to use this method for selecting a panning distance let's examine the example below.
Place a DXFReader control (Name property: DXFReader1) on a form.
Add the following code to the declaration section of the form
Option Explicit Private OnPanStart As Boolean Private OnPanEnd As Boolean Private X0 As Single Private Y0 As Single
and the following code to the Form1 Load event:
Private Sub Form1_Load()
DXFReader1.ReadDXF "Example.dxf"
End Sub
Place a Command Button (Name property: Command1) in the upper right corner of the form (set the Caption property to Pan). Add the following code to the Command1 Click event:
Private Sub Command1_Click()
OnPanStart = True DXFReader1.MousePointer = drCross
End Sub
Add the following code to the DXFReader1 MouseUp event:
If OnPanEnd Then DXFReader1.Pan X0, Y0, X, Y OnPanEnd = False DXFReader1.MousePointer = drDefault End If
If OnPanStart Then X0 = X Y0 = Y OnPanStart = False OnPanEnd = True End If
Add the following code to the DXFReader1 MouseMove event:
If OnPanEnd Then
DXFReader1.ShowRubberLine X0, Y0, X, Y
End If
The parameters for the ShowRubberLine method are described below:
| X1 | X coordinate of the start of the segment | | Y1 | Y coordinate of the start of the segment | | X2 | X coordinate of the end of the segment | | Y2 | Y coordinate of the end of the segment |
|