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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to close multiple MDI child forms with TabbedMDIManager

Thread ID:





59350 Apr 11,2007 02:59 PM UTC Apr 19,2007 10:25 AM UTC WinForms 2
Tags: Tools
James Sandys-Lumsdaine
Asked On April 11, 2007 02:59 PM UTC


I'm using the TabbedMDIManager and I want to have a "Close All" menu option in my Window menu - I've tried several methods to close all windows, starting with closing each Form in the rootForm.MdiChildren collection but this causes a null pointer exception.

If I was using a normal MDI form I would get rootForm.OwnedForms - but this collection is empty. Could you advise or point to an example to do this?

I'll also be adding a "Close All But This" - which leaves the active child form.



James Sandys-Lumsdaine
Replied On April 12, 2007 08:08 AM UTC

I think I stumbled on the answer - use the tabbedMDIManager.MDIChildren property:

foreach (Form form in tabbedMDIManager.MdiChildren)
if (ActiveMdiChild != form)

Poly J [Syncfusion]
Replied On April 19, 2007 10:25 AM UTC

Hi Jas,

Thanks for the update.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon