I am allowing a user to delete a series from the chartlistbox control but I would like to know which series is being deleted (series index or the selected index that the delete key was pressed on). I was thinking that the RemovedSeries event would tell me which series was being removed. However, when I look in the event handler I could not determine this. The selected index is -1.
How can I tell which series index is being deleted?
It looks like removedseries is called before the actual remove becuase the list still has the series in it. Is this true?
chartlistbox1_RemovedSeries
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi johnf,
You can do something like in the code below which works fine for me hre.
You can do something like in the code below which works fine for me hre.
Code: Select all
public Form1()
{
InitializeComponent();
for (int i = 0; i < 3; i++)
{
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.FillSampleValues();
}
chartListBox1.KeyDown += new KeyEventHandler(chartListBox1_KeyDown);
}
void chartListBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete)
{
tChart1.Header.Text = chartListBox1.SelectedIndex.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 |