Hi !
In our application, users can create as many rectangles as they want. How could we know the tool index of the rectangle clicked throw the event AxTChart_OnRectangleToolClick?
Thank for your answer
Guilz
Rectangle Tool Clicked - How to retrieve tool index
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Rectangle Tool Clicked - How to retrieve tool index
Hi Guilz,
You can use tool's Clicked method, for example:
You can use tool's Clicked method, for example:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
axTChart1.AddSeries(TeeChart.ESeriesClass.scLine);
axTChart1.Series(0).FillSampleValues();
for (int i = 0; i < 5; i++)
{
axTChart1.Tools.Add(TeeChart.EToolClass.tcRectangle);
}
}
private void axTChart1_OnRectangleToolClick(object sender, AxTeeChart.ITChartEvents_OnRectangleToolClickEvent e)
{
int index = -1;
for (int i = 0; i < axTChart1.Tools.Count; i++)
{
if (axTChart1.Tools.Items[i].asRectangle.Clicked(e.x, e.y))
{
index = i;
break;
}
}
axTChart1.Header.Text.Clear();
axTChart1.Header.Text.Add(index.ToString());
}
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 |
Re: Rectangle Tool Clicked - How to retrieve tool index
Thank you Narcis - Works fine for me
Regards,
Guilz
Regards,
Guilz