MDI Child Forms and the Closing Event

  • 18 years ago

    How do keep a child form from closing while still
    allowing the MDI window to close?


    I've been using a Closing event on the child form,
    but it seems that the closing event also ends up
    happening for the MDI form also.


    The only code in the event is:
    e.Cancel = true;


    any ideas?


    thanks,
    - Mike

  • 18 years ago

    If anyone has a better way, please tell me.


    How I was able to do it was to just override WndProc
    and handle the WMCLOSE message myself.
    And WM
    CLOSE is only happening for the MDI
    window.


    I still have the Closing event though.


    I certainly hope there's a better way.


Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” - Antoine de Saint Exupéry