Dispose problem/crash with maximized MDI child windows

T

Tom

I am having a serious issue with my MDI child windows. This is with a
large VB.NET application that I ported over to VS 2005 from VS 2003.
The problem is that, if the child window is maximized and then closed,
it produces the following error message:

Cannot access a disposed object
Object name:'icon' in source System.Drawing

And then the whole system crashes. Again, this ONLY occurs if the MDI
child window is maximized within the MDI frame and then closed while it
is maximized.

I have reason to believe it has something to do with the MDI child
window's icon. If I remove the icon from the child window (i.e. just
use the VB.NET default) then it closes while maximized without any
problem. I thought it might have something to do with the assigned icon
not having a 16x16 size image, but I found one case where even then it
still crashed.

I am stumped at this point and can only assume this is some kind of
..NET 2.0 error/bug. This never had a problem at all in VS 2003 - only
VS 2005. Anyone have ANY ideas as to how to fix this? I really hate to
have to go thru all my windows and remove all the form icons....

Any help appreciated. Thanks in advance.

Tom
--
 
V

vnoga

Seems you ran into this annoying bug 2 days before me.

I'm using C# in VS 2005. It's a brand new project (ie. not a port from
VS 2003).

I have the same symptoms as you. Try and close a maximized MDI
childwindow, where you assigned an icon to your form, and wa-la, the
application crashes.

I've written MDI apps in VS 2003 and never, ever had this problem.
This has to be a bug in .Net 2.0.

I too don't want to remove our companies icon from all my forms, but at
this point, do see any choice.


Vince
 
V

vnoga

The problem is the System.Windows.Forms.MenuStrip not playing nice with
MDI child forms. The issue has been /bugged at
connect.microsoft.com/VisualStudio/feedback.

Until someone comes up with a real solution, either use the default
Visual Studio icon for all your child forms, or do not set the
MenuStrip.MdiWindowListItem property.

For now, I'm choosing the latter (I don't have time to debug/workaround
my development tool!)


Vince
 
V

vnoga

The ID# is 166879 if you care to add anything to the issue. I recommed
you do as the squeaky wheel gets the grease.

Vince
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top