dropcursor addcursor removecursor

Discussion created by cpl on Feb 8, 2011
Latest reply on Feb 8, 2011 by cpl

I've got several trends on a PDI. From any given trend, i am using the DropCursor to perform an AddCursor to the remaining trends so that all trends will show cursor values base off the original DropCursor.  Now I've got 'x' number of trends all displaying the same cursor time and associated values. When I remove a cursor from a trend (by dragging it off the trend), I would like all corresponding cursors on the other trends to be removed. Unfortunately the DropCursor function is not called when dragging a cursor off a trend. Ideas on how I can make this work? Below is a code snippet of how the cursors are set.

Dim myTrends() As Trend, myTrend As Trend

Private Sub Trend1_DropCursor(bCancel As Boolean, ByVal nCursor As Integer, ByVal NewTime As String)

    Set myTrend = Trend1
    myTrend.CurrentCursor = nCursor
    myTrend.CursorTime = NewTime

End Sub

Private Sub doTrendCursor()
Dim xx As Integer, yy As Integer

For xx = 0 To UBound(myTrends)
    If myTrends(xx).Name <> myTrend.Name Then
        For yy = myTrends(xx).CursorCount To 1 Step -1
            myTrends(xx).RemoveCursor (yy)
        For yy = 1 To myTrend.CursorCount
            myTrend.CurrentCursor = yy
            myTrends(xx).CurrentCursor = myTrend.CurrentCursor
            myTrends(xx).CursorTime = myTrend.CursorTime
    End If

End Sub