469,904 Members | 2,123 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

What is the proper way to cancel the closing of a MDI application?


I have an MDI application. If the user presses the close button (the X in
the upper right), I need to check each child form and see if it is dirty and
give the user an opportunity a) lose their changes, b) save changes and
continue closing, or c) abort the close action. I have code that presents
these choices and does the correct thing from the MDI child's point of view,
but I am search for a mechanism for notifying the MDI parent that a child
has aborted the close. So far my code looks like:

Private Sub myApp_Closing(byVal sender as object, byVal e as
System.ComponentModule.CancelEventArgs) Handles MyBase.Closing
Dim frm as form
for each frm in me.MdiChildren
End sub

I suppose I could add some global that I check each time in the loop, but I
thought that Windows.Net had a better mechanism.

Any thoughts?


Nov 19 '05 #1
0 983

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Matthew | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.