Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
2.00/5 (3 votes)
See more:
how to handle with ObjectDisposedException ?
Posted
Comments
Richard C Bishop 5-Mar-13 11:20am    
You have got to be kidding.
[no name] 5-Mar-13 11:21am    
Simple, don't try and use objects that have been Disposed.

1 solution

in c# you can not bound an Object.

if CLR find that this object is not longer usable it Disposed from the memory .

if you want CLR not Dispose your object . then store it in an static var

like

//

public static Form _F;

Form f=new Form();
_F=f;

now this object never Dispose by CLR until the application will close
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900