03-01-2005 03:22 PM
03-01-2005 04:18 PM
Private Sub BringCursorToCenter()
If Not (XyCursor1.Plot Is Nothing) Then
Dim xRange As Range = Range.Empty
Dim yRange As Range = Range.Empty
If Not (XyCursor1.Plot.XAxis Is Nothing) Then
xRange = XyCursor1.Plot.XAxis.Range
End If
If Not (XyCursor1.Plot.YAxis Is Nothing) Then
yRange = XyCursor1.Plot.YAxis.Range
End If
Dim xCenter As Double = (xRange.Maximum + xRange.Minimum) / 2
Dim yCenter As Double = (yRange.Maximum + yRange.Minimum) / 2
XyCursor1.MoveCursor(xCenter, yCenter)
End If
End Sub
AddHandler waveformGraph.Zoom, AddressOf OnWaveformGraphZoom
Private Sub OnWaveformGraphZoom(ByVal sender As System.Object, ByVal e As NationalInstruments.UI.ActionEventArgs)
BringCursorToCenter()
End Sub