472,142 Members | 1,288 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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 1020

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Matthew | last post: by
reply views Thread by leo001 | last post: by

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.