Page 1 of 1

TeeChart problems in VS2005 with v3 and tabs

Posted: Fri Oct 12, 2007 9:35 pm
by 6921081
I'm working with VS2005 and v3 and having a problem with a teechart on a tab control. If the chart is on the first tab, things work fine. However, if the chart is on the 2nd tab, I get an 'Object reference not set to an instance of an object.' when trying to close the form. The error occurs when the form tries to dispose of the chart. If you click on the tab that contains the chart, things work fine when closing, but if you don't click on the tab with the chart, you get the error.

Posted: Mon Oct 15, 2007 8:16 am
by narcis
Hi Retail Dev,

Thanks for reporting. I've been able to reproduce this running and closing the application without opening the tab where the chart is. Can you confirm this is the same problem you see? Anyway, I've added it (TF02012518) to our defect list to be fixed for future releases.

Thanks in advance!

Posted: Mon Oct 15, 2007 1:48 pm
by 6921081
Yes, this is the same problem. Is there anything you know of that we can do to get around this problem for the time being? And thank you for your help.

Posted: Mon Oct 15, 2007 2:33 pm
by narcis
Hi Retail Dev,

The only workaround I can think of at the moment is setting the SelectedTab to be the chart's tab when the application starts and as soon as the chart has been painted set SelectedTab to the initial tab in the chart's AfterDraw event, for example:

Code: Select all

		private void Form1_Load(object sender, EventArgs e)
		{
			tabControl1.SelectedTab = tabPage2;
		}

		private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			tabControl1.SelectedTab = tabPage1;
		}
Hope this helps!