I'm using TeeChart AX 7.x.
I want to get position of ColorLineTool by mouse dragging.
How can I do this?
Thank you.
How get position from ColorLineTool
Hi greenfrog,
You can something like following:
This is shown in ColorLine Demo from v8. And if you wish to have more than one ColorLines and you want to control which is dragged you should store mouse positions with OnMouseMove and use the method clicked to verify which ColorLine is dragged:
You can something like following:
Code: Select all
Private Sub TChart1_OnColorLineToolDragLine()
Label1.Caption = Str$(FormatNumber(TChart1.Tools.Items(0).asColorLine.Value, 2))
End Sub
Code: Select all
Dim MouseX, MouseY As Double
Private Sub TChart1_OnColorLineToolDragLine()
If TChart1.Tools.Items(0).asColorLine.clicked(MouseX, MouseY) Then
Label1.Caption = Str$(FormatNumber(TChart1.Tools.Items(0).asColorLine.Value, 2))
End If
If TChart1.Tools.Items(1).asColorLine.clicked(MouseX, MouseY) Then
Label1.Caption = Str$(FormatNumber(TChart1.Tools.Items(1).asColorLine.Value, 2))
End If
End Sub
Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
MouseX = X
MouseY = Y
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |