Parent/Child error message on open

G

Guest

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
 
G

Guest

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.
 

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