We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

C# Windows MDI Parent Form

There are 5 child forms in an MDI Parent Form.When I close the MDI Parent Form it fires first close event of child form.Actually i have written some code on Child Close form. I donot want to fire child close event when i close theMDI Parent Form. Is there any way so that when i close MDI Parent form it checks whether this close is clicked by MDI parent form or by Child Form close click. Thanks

1 Reply

CB Clay Burch Syncfusion Team July 22, 2002 04:54 AM UTC

In the Parent Form, you can catch a click on the parent Form's System Menu Close box using the FAQ referenced below. The idea is to override WndProc, and look for a SYSCOMMAND call to SC_CLOSE. If you don't want the close to go through, just return without calling the baseclass. ==================== How can I tell if a form is closed from the controlbox (system menu) or from a call to Form.Close? Check it out at: http://www.syncfusion.com/faq/winforms/search/862.asp

Live Chat Icon For mobile
Up arrow icon