Disposed Object

P

Peter W Johnson

Hi Guys,

I have a small program that uses parent and child mdi windows.

The program loads with the parent window
click on the main menu to open a child window
On the child window click on a dropdownbox to select a name
click on a button in the same child window to open another child window
within the parent passing the name variable
the second child window opens and displays the data relevant to that name
variable.
close this child window using the "X" in the top righthand corner (Close &
Save button not yet implemented)

If I select another name from the first child window and click the button to
open the second child window with new information I get the following
error:-

"SystemObjectDisposeException cannot access a disposed object name
frmNewMember"

Any ideas on how to close the second child window without "disposing" of it?

Many thanks

Peter.
 
C

Cor Ligthert

Peter,

You can use the Isdisposed property from a form to see if it still exist.
When not, then you create it new and show otherwise you just show.

However there are a lot of solutions for this.

I hope this helps,

Cor
 
P

Peter W Johnson

Cor,

Thanks for the pointer. managed to get things working OK.

Cheers

Peter.
 

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