DXFReaderNETControlPan Method |
Namespace: DXFReaderNET
[C#] private Vector2 panPointStart = Vector2.Zero; private void dxfReaderNETControl1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Middle) { dxfReaderNETControl1.Cursor = Cursors.Hand; panPointStart = dxfReaderNETControl1.CurrentWCSpoint; } } private void dxfReaderNETControl1_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Middle) dxfReaderNETControl1.Pan(dxfReaderNETControl1.CurrentWCSpoint, panPointStart); } private void dxfReaderNETControl1_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Middle) dxfReaderNETControl1.CustomCursor = CustomCursorType.CrossHair; }
[Visual Basic] Private panPointStart As Vector2 = Vector2.Zero Private Sub dxfReaderNETControl1_MouseDown(sender As Object, e As MouseEventArgs) Handles dxfReaderNETControl1.MouseDown If e.Button = MouseButtons.Middle Then dxfReaderNETControl1.Cursor = Cursors.Hand panPointStart = dxfReaderNETControl1.CurrentWCSpoint End If End Sub Private Sub dxfReaderNETControl1_MouseMove(sender As Object, e As MouseEventArgs) Handles dxfReaderNETControl1.MouseMove If e.Button = MouseButtons.Middle Then dxfReaderNETControl1.Pan(dxfReaderNETControl1.CurrentWCSpoint, panPointStart) End Sub Private Sub dxfReaderNETControl1_MouseUp(sender As Object, e As MouseEventArgs) Handles dxfReaderNETControl1.MouseUp If e.Button = MouseButtons.Middle Then dxfReaderNETControl1.CustomCursor = CustomCursorType.CrossHair End Sub