473,395 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How do I close ALL MDI Child windows?

Hello all,
Is there a way that I can close all the mdi child windows from the mdi
parent's menu item? For example, on the MDI parent from, I have a MainMenu
with "File" and "Close All" menu items. I want that when a user clicks on
"File" then chooses "Close All", all the currently open MDI child windows
are close (the application should be still running). Can someone points me
to the right direction please?
Thank you very much.
Stanav.
Nov 21 '05 #1
3 17003
ng
Try this:

For i = 0 To Me.MdiChildren.Length - 1
Me.MdiChildren(i).close()
Next

Tom
VhD50 wrote:
Hello all,
Is there a way that I can close all the mdi child windows from the mdi
parent's menu item? For example, on the MDI parent from, I have a MainMenu
with "File" and "Close All" menu items. I want that when a user clicks on
"File" then chooses "Close All", all the currently open MDI child windows
are close (the application should be still running). Can someone points me
to the right direction please?
Thank you very much.
Stanav.

Nov 21 '05 #2
Thank for the tip, NG. It works after a little modification to the code you
gave me:

For i = Me.MdiChildren.Length - 1 To 0 Step -1
Me.MdiChildren(i).close()
Next

(without stepping backward in the "For" loop, I'll get "Out of Bound"
Exception)
Thanks again.
VhD50

"ng" <t_*****@yahoo.com> wrote in message
news:de*****************@bignews5.bellsouth.net...
Try this:

For i = 0 To Me.MdiChildren.Length - 1
Me.MdiChildren(i).close()
Next

Tom
VhD50 wrote:
Hello all,
Is there a way that I can close all the mdi child windows from the mdi
parent's menu item? For example, on the MDI parent from, I have a MainMenu
with "File" and "Close All" menu items. I want that when a user clicks on
"File" then chooses "Close All", all the currently open MDI child windows
are close (the application should be still running). Can someone points me
to the right direction please?
Thank you very much.
Stanav.

Nov 21 '05 #3
Thank for the tip, NG. It works after a little modification to the code you
gave me:

For i = Me.MdiChildren.Length - 1 To 0 Step -1
Me.MdiChildren(i).close()
Next

(without stepping backward in the "For" loop, I'll get "Out of Bound"
Exception)
Thanks again.
VhD50

"ng" <t_*****@yahoo.com> wrote in message
news:de*****************@bignews5.bellsouth.net...
Try this:

For i = 0 To Me.MdiChildren.Length - 1
Me.MdiChildren(i).close()
Next

Tom
VhD50 wrote:
Hello all,
Is there a way that I can close all the mdi child windows from the mdi
parent's menu item? For example, on the MDI parent from, I have a MainMenu
with "File" and "Close All" menu items. I want that when a user clicks on
"File" then chooses "Close All", all the currently open MDI child windows
are close (the application should be still running). Can someone points me
to the right direction please?
Thank you very much.
Stanav.

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: jrefactors | last post by:
>From the main page, there are lots of links to open new window. i.e. <a href="#" onClick="window.open('child1.html')">Open Child Window</a> If I close the main page, I want to close all child...
2
by: Ron L | last post by:
I have an MDI application which opens a number of child windows, each of which could have data in a state that needs to be saved. Each child window catches its Closing event and cancels it if the...
3
by: Isabel | last post by:
How can you close all child browser windows that where open by a parent browser window? I have links on a parent (main) page that opens the child page as a separate browser. However, I need to be...
2
by: Paul | last post by:
Hi this is related to a previous post, hopefully just a bit clearer description o the problem. I have a parent form that opens a new form (child form) while still leaving the parent form open....
1
by: nomaam | last post by:
i am useing VB.NET, and am working in a windows form. my form interacts with Internet Explorer, and i would like only the main IE window to be open. i know how to terminate a process, but how...
0
by: Tom | last post by:
Let's say I have an MDI parent that has 5 open child windows in it. Now let's say that I have a function in the MDI parent that attempts to close all the child windows. It's starts running, closing...
6
zybernau
by: zybernau | last post by:
hi, all in javascript i need to close all the child windows that i have opened through a parent window scenario: * here i will be having as many as child window opened and name given to...
3
by: newsteve1 | last post by:
Hi, Im trying to design a fun page where a after an onclick on the parent page, several small child windows are opened. Upon clicking the content of any of those windows, I want all of the child...
5
by: Nithu25 | last post by:
Hi All, I have a parent window where i have three links. On clicking those links, new window will be opened as a pop up. When i logout from the parent window, the child windows should be closed....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.