Bug using TeeChart .NET v3 in dialog

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
AndreAtDeltares
Newbie
Newbie
Posts: 7
Joined: Fri May 25, 2007 12:00 am
Location: Delft
Contact:

Bug using TeeChart .NET v3 in dialog

Post by AndreAtDeltares » Wed Jan 12, 2011 4:36 pm

Dear all,

When using the latest release of TeeChart .NET v3 (build 3.5.3700.30575) and Visual Studio 2008 (9.0.30729.1 SP), I get an exception when opening a dialog with a chart on it for the second time. First time it opens okay, second time an ArgumentException is thrown ({"Parameter is not valid."}), by the looks of the stack-trace because teechart is using an invalid pointer to a graphics context. The last 4 lines of the trace say:
at System.Drawing.Graphics.GetHdc()
at System.Drawing.BufferedGraphics.Render(Graphics target)
at System.Drawing.BufferedGraphics.Render()
at Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe)
In the attachment I have an example solution, with the chart on dialog1. Fix the reference to TeeChart, compile and just open it 2 times: the second time it will crash!

Yours,

André Hendriks
Deltares
Attachments
TestDialogs.zip
(21.88 KiB) Downloaded 331 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Bug using TeeChart .NET v3 in dialog

Post by Sandra » Thu Jan 13, 2011 10:12 am

Hello André,
I think you have a problem with buffer, for this reason appears ArgumentsException({"Parameter is not valid."}). I can reproduce your problem and I suggest you a solution. You only have to change the tChart1.Graphics3D.BufferStyle for DoubleBuffer or None in the close button of your Dialog1 as do in below lines of code:

Code: Select all

private void buttonClose_Click(object sender, EventArgs e
        {
            tChart1.Graphics3D.BufferStyle = Steema.TeeChart.Drawing.BufferStyle.DoubleBuffer//.None;
            this.Close();
        }
Could you tell us if previous code works as you want? If you have some problems, please let me know.

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / 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

AndreAtDeltares
Newbie
Newbie
Posts: 7
Joined: Fri May 25, 2007 12:00 am
Location: Delft
Contact:

Re: Bug using TeeChart .NET v3 in dialog

Post by AndreAtDeltares » Fri Jan 14, 2011 8:26 am

Dear Sandra,

Works like a breeze, both in my example and in the real code. Thank you so much!

André

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Bug using TeeChart .NET v3 in dialog

Post by Sandra » Fri Jan 14, 2011 10:00 am

Hello André,

I am glad that solution works fine for you :).

Thanks,
Best Regards,
Sandra Pazos / 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