471,355 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,355 software developers and data experts.

Parent/Child error message on open

Hello,

I have a parent form, with a menu item used to open the child form.
If I open the child form, then close it, and try to reopen it from the
parent, I get the error message:

An unhandled exception of type 'System.ObjectDisposedException' occurred in
system.windows.forms.dll

Additional information: Cannot access a disposed object named "frm1".

What is causing this?

Thanks,
Amber
Jul 21 '05 #1
1 1363
I'm guessing that when the form is closed, it is automatically disposed. You
may want to create a new instance of the form everytime the MenuItem's Click
event is called, or use a try, catch structure to recreate it if is disposed.
Good luck.

"amber" wrote:
Hello,

I have a parent form, with a menu item used to open the child form.
If I open the child form, then close it, and try to reopen it from the
parent, I get the error message:

An unhandled exception of type 'System.ObjectDisposedException' occurred in
system.windows.forms.dll

Additional information: Cannot access a disposed object named "frm1".

What is causing this?

Thanks,
Amber

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Bill Borg | last post: by
1 post views Thread by amber | last post: by
reply views Thread by =?Utf-8?B?UGF1bA==?= | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.