Close all open MDIChield form - VB 6.0

Development environment: Visual Basic 6.0

In my application, I have one MDIform and 4 MDI Chiledform.
In Menu (At MDIForm), there is a option "Close All Window".

I want if user select that option then it will be close all open MDI Chieldforms.
Please help me how to do this or what is the code I have to write for this ?

MDIform Name : MDISA

Chiled form name : 1. frmSA1; 2. frmSA2; 3. frmSA3; 4. frmSA4.

Anirban Dasgupta.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

anirban_abnAuthor Commented:
Close All Open MDI Chieldform - VB 6.0
Close All Child Forms in One Shot
In MDI applications, a user might have two or three or even more MDI child windows open at any given time. But in applications where you have user log-in and log-out security, you likely want to unload all open forms when the user logs out. To accomplish this, use this small piece of code:

Do Until MDIform1.ActiveForm Is Nothing
      Unload MDIform1.ActiveForm

If you need to save any values in any form by default, you can include a call to the appropriate Save method in the Unload event of that form.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
anirban_abnAuthor Commented:
Thank you Dhaest.
It is working fine. Can you tell me one thing more, how can I understand any chiled window is currently open or not ?

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.