all groups > dotnet windows forms > september 2003 >
You're in the

dotnet windows forms

group:

Determine if child window has been closed


Determine if child window has been closed Markus Wildgruber
9/30/2003 5:39:44 PM
dotnet windows forms:
Hi!

We have an Mdi-parent window and want to close all of its children. The user
should be able to cancel the closing-procedure (e.g. when the contents of
the child window have been modified and the user clicks 'cancel' in the
messagebox that asks if the contents should be saved).
How can we determine if the closing of the child window has been canceled
after calling the Close-method on the child window-object?

TIA,

Markus

--
##########################################
Please do not send replies to msdngroups@syska.de.
Mails sent to that adress will be deleted without being read.

Re: Determine if child window has been closed hirf-spam-me-here NO[at]SPAM gmx.at
9/30/2003 6:20:05 PM
"Markus Wildgruber" <msdngroups@syska.de> scripsit:
[quoted text, click to view]

You can check if the form should be closed in its 'Closing' event. Set
'e.Cancel = True' to cancel closing.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
Re: Determine if child window has been closed Markus Wildgruber
10/1/2003 10:36:02 AM
Hi!

Thanks for your reply, but there has been a little misunderstanding.
Our problem is not how to cancel the closing of the child window, we use the
Closing-event as you described.
We call childWindow.Close() in the Mdi-parent window. The window will be
closed (in most cases) but we can not be sure if that this is really the
case as the user is able to cancel the closing.

So, how can we determine whether the child window has been closed after the
call to childWindow.Close()?

TIA,

Markus

"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> schrieb im Newsbeitrag
news:eDOzb82hDHA.2884@tk2msftngp13.phx.gbl...
[quoted text, click to view]

Re: Determine if child window has been closed hirf-spam-me-here NO[at]SPAM gmx.at
10/1/2003 12:15:49 PM
"Markus Wildgruber" <msdngroups@syska.de> scripsit:
[quoted text, click to view]

You can loop through the items in the MDI container's 'MdiChildren'
property and check if the form still exists there.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
AddThis Social Bookmark Button