How do I get the index of the currently selected line?
For example, I have several lines using Drawline array:
Dim I1() As Steema.TeeChart.Tools.DrawLineItem
DrawLine5.Pen.Color = DefaultColor2 'Drawing.Color.Gray
DrawLine5.Pen.Width = 1
DrawLine5.Active = True
DrawLine5.EnableSelect = True
DrawLine5.Lines.Clear()
DrawLine5.Pen.Style = Drawing2D.DashStyle.Solid
For i =1 to 5
ReDim Preserve I1(i)
I1(i) = New Steema.TeeChart.Tools.DrawLineItem(DrawLine5)
I1(i).StartPos = New Steema.TeeChart.Drawing.PointDouble(LinX1, LinY1)
I1(i).EndPos = New Steema.TeeChart.Drawing.PointDouble(LinX2, LinY2)
DrawLine5.EnableDraw = False
Next i
I need to get the index of Drawline5.Lines(Index) of the line selected with a mouse
There is a Drawline5_Selecting event but no index property I can find?
Getting Index of Currently Selected Line
Re: Getting Index of Currently Selected Line
I am using the popular method of searching line coordinates to get the index. If you know of an easier method let me know?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Getting Index of Currently Selected Line
Hi lilo,
You can use DrawLine's clicked method in the chart mouse events where you provide X and Y coordinates and it returns an index or -1 if no line has been clicked.
You can use DrawLine's clicked method in the chart mouse events where you provide X and Y coordinates and it returns an index or -1 if no line has been clicked.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |