I have a problem with TeeChart v3. Currently I'm using version 3.5.3498.27367. I assume it will also be a problem in the newer v3 version and/or version 2009. You can download a demonstrator project from my webspace http://users.edpnet.be/avathar/NMDG/Tee ... 20Form.zip and compile for yourself.
The problem is that some exception is generated from deep down in the drawing routines of TeeChart. When you have a form with a TeeChart on it (in my example called TeeChartForm), and you dare to change the MDIParent while the form is visible, you'll get the following exception:
Code: Select all
System.ArgumentException: Parameter is not valid.
at System.Drawing.Graphics.GetHdc()
at System.Drawing.BufferedGraphics.Render(Graphics target)
at System.Drawing.BufferedGraphics.Render()
at Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Just run the example. First you will just see an empty form in the MDI. Through the Tools menu you can dock/undock the form. You will see that everything works fine until then.
Then through the Tools menu you can make the TeeChart component visible. Now try to dock/undock, and you will see the exception.
We have not seen a similar problem with forms with other controls on it. We have tested a lot of complex forms with all kind of controls on it, and none of them gave any problem. So the problem is not coming from the .NET framework drawing engine, but specifically from the TeeChart component and when you use that one.
I already used the OnPaint method to hook into the drawing and monitor some of the parameters, but at this moment I was not able to catch where the problem comes from.
FYI... I'm using Visual Studio 2005 and .NET framework 2.0 SP2.
kind regards,
Dimitri