How to handle the close (big X) button at the source?

Posted by Simon T. on Stack Overflow See other posts from Stack Overflow or by Simon T.
Published on 2010-04-22T17:09:00Z Indexed on 2010/04/22 18:53 UTC
Read the original article Hit count: 172

Filed under:
|

We would like under some circumstances to block the action of the close button in the title bar. The problem is that it's a MDI applications and it seems that we will have to add code in each forms to cancel the operation in the Closingevent handler. It seems that the child forms are the first to receive the event. There is no way to add code at a single place to cancel the close operation. Information on how the close event is propagated to the child form would be welcome. Is there a simple way of doing what we want to do?

© Stack Overflow or respective owner

Related posts about winforms

Related posts about .NET