Page 1 of 1

Null reference exception on OnPaint Event

Posted: Fri Apr 28, 2017 9:40 am
by 15679295
Hi

On one PC the teechart works as expected, on an other pc we have sometimes null reference (System.NullReferenceException) exceptions on the TeeChart.TChart.OnPaint, the first method is System.Windows.Forms.NativeWindow.DebuggableCallback. Is there a possibility to log some output for the teechart to find the error. No of our code is in the stack trace but may be it's the cause from wrong values. We use the version 4.1.2017.2145


Stack Trace:

bei Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe)
2 bei System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
3 bei System.Windows.Forms.Control.WmPaint(Message& m)
4 bei System.Windows.Forms.Control.WndProc(Message& m)
5 bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Regards
T. Harder

Re: Null reference exception on OnPaint Event

Posted: Tue May 02, 2017 7:43 am
by Christopher
Hello,

Do you have any more information on the error, for example, exactly which object is throwing the null reference exception?

Do you get the same error when you set the Graphics3D.BufferStyle to something other than the default, e.g.

Code: Select all

tChart1.Graphics3D.BufferStyle = BufferStyle.DoubleBuffer;
(default is OptimizedBuffer)