|
Private Sub
DynaPlot1_MouseDown(Button As Integer, Shift As Integer, X As Long, Y As Long)
If DynaPlot1.Cursors.Enable.State = False Then
Dim newX As Double, newY As Double
' compute physical coordinates of the mouse position
newX = DynaPlot1.Axes.XAxis.PhysicalCoordinate(X) newY = DynaPlot1.Axes.YAxis.PhysicalCoordinate(Y)
If newX >= DynaPlot1.Axes.XAxis.From And _ newX <= DynaPlot1.Axes.XAxis.To And _
newY >= DynaPlot1.Axes.YAxis.From And _ newY <= DynaPlot1.Axes.YAxis.To Then
' switch the cursor on DynaPlot1.Cursors.Enable.State = True
' move the cursor to where the mouse is DynaPlot1.Cursors.Move newX, newY End If End If
End Sub
|