chartlistbox1_RemovedSeries

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
johnf
Newbie
Newbie
Posts: 6
Joined: Mon Jun 11, 2007 12:00 am

chartlistbox1_RemovedSeries

Post by johnf » Sat Feb 23, 2008 4:16 pm

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?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Feb 25, 2008 10:46 am

Hi johnf,

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
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply