|
Description
|
Shows the window specified by the X1, Y1, X2 and Y2 parameters. as a dashed rectangle.
|
|
Syntax
|
[form.]DXFReader.ShowRubberBox (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 zooming or selecting a rectangular shape.
To show how to use this method for selecting a zooming window 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 OnZoomWindowStart As Boolean Private OnZoomWindowEnd 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 Zoom Window). Add the following code to the Command1 Click event:
Private Sub Command1_Click()
OnZoomWindowStart = True DXFReader1.MousePointer = drCross
End Sub
Add the following code to the DXFReader1 MouseUp event:
If OnZoomWindowEnd Then DXFReader1.ZoomWindow X0, Y0, X, Y OnZoomWindowEnd = False DXFReader1.MousePointer = drDefault End If
If OnZoomWindowStart Then X0 = X Y0 = Y OnZoomWindowStart = False OnZoomWindowEnd = True End If
Add the following code to the DXFReader1 MouseMove event:
If OnZoomWindowEnd Then DXFReader1.ShowRubberBox X0, Y0, X, Y End If
The parameters for the ShowRubberBox method are described below:
| X1 | X coordinate of the lower-left corner | | Y1 | Y coordinate of the lower-left corner | | X2 | X coordinate of the upper-right corner | | Y2 | Y coordinate of the upper-right corner |
|