Click here to Skip to main content
15,914,608 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
According to MSDN:

Control.Disposing Property Gets a value indicating whether the base Control class is in the process of disposing.

But when I checked, Disposing property of the control is always false (inside the Dispose() method itself).

When will this Disposing property become true?
Posted

Hi,

As MSDN describes, Control.Disposing property will return true if the control in the process of disposing. so, when check normally, it returns false, the property will return true when the Control_Disposing event will be fired. when the disposing event will fire, that means the control got disposed. during the disposing event the Disposing property will return true.

hope it helps.
 
Share this answer
 
Comments
StianSandberg 25-Apr-13 7:33am    
5'd
Karthik Harve 25-Apr-13 7:34am    
Thanks !!!
Kaizen202 25-Apr-13 9:10am    
Yes.
It will be true in the disposing event of base control. I have checked the MSDN implementation. In Dispose() method of Control class, the property is set as true in disposing code block and it is reset to false after disposed.
hi,


Control.Dispose(boolean)[^]

I hope it will help you.
 
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