Page 1 of 1

Access to Steema.TeeChart.Chart.ChartRect ?

Posted: Sun Mar 16, 2008 12:24 pm
by 13048239
Hello,

VS 2005 is giving me the following warning (sorry this is the German version, I will translate it below)
Das Zugreifen auf einen Member auf "Steema.TeeChart.Chart.ChartRect" kann zu einer Laufzeitausnahme führen, da es sich hierbei um ein Feld einer Marshal-by-reference-Klasse handelt.


Translated:

Accessing the member of "Steema.TeeChart.Chart.ChartRect" may cause a runtime exception, because it is a field of a Marshal-by-reference-Class.

What is the recommended way to avoid this warning (i.e. to access
Steema.TeeChart.Chart.ChartRect in a secure way)?

Michael

Posted: Mon Mar 17, 2008 9:11 am
by narcis
Hi Michael,

Yes, line below produces such warning.

Code: Select all

			int w1 = tChart1.Chart.ChartRect.Width;
You can avoid it doing this:

Code: Select all

			Rectangle rect = tChart1.Chart.ChartRect;
			int w2 = rect.Width;