Hi, I created a chart on a subform and then I create an object of the subform in my main form initialization. I can click a showGraph button which will execute subform.showDialogue() or subform.show(). When I am done viewing the subform, I call subform.hide(). This works great.
However, when I try to view the form again by clicking on the showGraph button from the main form, I get this error:
ArgumentException was unhandled
Parameter is not valid.
I have uploaded a Test project that will demonstrate this (DragPoint_FlatLine.zip). Simply click Show Graph, then close the new form, and click Show Graph again.
Maybe I shouldn't be coding it this way, but any ideas/suggestions?
Thanks
Exception when re-showing subform with graph
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Exception when re-showing subform with graph
Hi LibDundas,
Using Show instead of ShowDialog works fine for me, for example:
Can you please try if this solves the problem at your end?
Using Show instead of ShowDialog works fine for me, for example:
Code: Select all
private void btnShowGraph_Click(object sender, EventArgs e)
{
try
{
//frmGraph.ShowDialog(this);
frmGraph.Show(this);
}
catch (Exception ex)
{
int temp = 0;
throw;
}
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Exception when re-showing subform with graph
Hi Narcís, using Show() does work. I originally chose to use ShowDialog() so the user was forced to work on the form that I popped up.Narcís wrote:Hi LibDundas,
Can you please try if this solves the problem at your end?
Do you think this a bug with how TeeChart responds to a ShowDialog()?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Exception when re-showing subform with graph
Hi LibDundas,
I've stripped down all TeeChart code from your project and works fine either using ShowDialog or Show. I may still be missing something but I've added the issue (TF02014589) to the defect list to be investigated.
I've stripped down all TeeChart code from your project and works fine either using ShowDialog or Show. I may still be missing something but I've added the issue (TF02014589) to the defect list to be investigated.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Exception when re-showing subform with graph
Thanks Narcís...hopefully you guys can find out exactly what's wrong.Narcís wrote:I've added the issue (TF02014589) to the defect list to be investigated.
Re: Exception when re-showing subform with graph
Hi Narcís, do you know if this issue has been looked at? I also stripped down my example program but I still see the problem using the last version 4.0.Narcís wrote:I've stripped down all TeeChart code from your project and works fine either using ShowDialog or Show.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Exception when re-showing subform with graph
Hi LibDundas,
No, the issue hasn't been investigated yet. I recommend you to be aware at this forum or subscribe to our RSS news feed for new release announcements and what's fixed on them.
No, the issue hasn't been investigated yet. I recommend you to be aware at this forum or subscribe to our RSS news feed for new release announcements and what's fixed on them.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Exception when re-showing subform with graph
Hi LibDundas,
We have been investigating the issue and found it is not a bug.
When using the Graphics3D.BufferStyle = OptimizedBuffer (default setting) on a modal form and you hide it and reopen it, the System.Drawing.Graphics.GetHdc, the windows handle, gets mangled. To work around this problem, simply set the buffer to null when hiding the form so forcing TeeChart to create a new one. In your code this would look like:
We have been investigating the issue and found it is not a bug.
When using the Graphics3D.BufferStyle = OptimizedBuffer (default setting) on a modal form and you hide it and reopen it, the System.Drawing.Graphics.GetHdc, the windows handle, gets mangled. To work around this problem, simply set the buffer to null when hiding the form so forcing TeeChart to create a new one. In your code this would look like:
Code: Select all
private void btnClose_Click(object sender, EventArgs e)
{
this.tChart1.Graphics3D.BackBuffer = null;
this.Hide();
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |