Is there a way to move annotations with the mouse? May be trapping some events ?? I read the post of
03 Mar 2004 (asAnnotation custom position) but I cannot get the attachment.
Thanks in advance,
Paolo Saudin
Move annotation
Hi spol,
Here you have a fast example of how you could do this:
Here you have a fast example of how you could do this:
Code: Select all
Dim MoveAnnotation As Boolean
Private Sub Form_Load()
TChart1.Tools.Add tcAnnotate
TChart1.Tools.Items(0).asAnnotation.Text = "My annotation tool"
End Sub
Private Sub TChart1_OnMouseDown(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If TChart1.Tools.Items(0).asAnnotation.Clicked(X, Y) Then
MoveAnnotation = True
End If
End Sub
Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If MoveAnnotation Then
TChart1.Tools.Items(0).asAnnotation.Left = X
TChart1.Tools.Items(0).asAnnotation.Top = Y
End If
End Sub
Private Sub TChart1_OnMouseUp(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
MoveAnnotation = False
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |