I am using an MDIParent Form. When I close its child, the object of the child disposes. Is there a way to set child visibility to false instead of disposing?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Sure, you can cancel the close and hide it. It doesn't seem like a good thing to do, but you definitely can.
See Form.FormClosing Event (MSDN).
By default, when you close a form, it will be disposed. You have to override the
Closing
event to prevent it, for example:Yes. You can call the form's "Hide" method.
You can also override OnClosed and not call its base implementation; HOWEVER, when you DO want to dispose of the form, this may get in your way.
You can cancel the close event and hide instead.