R
Ron L
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 user wants to save the data,
but when the Application closes this event isn't thrown automatically. I
added a loop to close each child window, but can't seem find how to catch
the child window's cancel of the Closing event, so even if the user selects
cancel to the closing event the application closes anyway. Can anyone point
me in the right direction here?
Here is my application closing handler which closes each child window:
' Catch the application exit event and gracefully close all MDI child
windows
Private Sub ApplicationExiting(ByVal sender As System.Object, _
ByVal e As System.ComponentModel.CancelEventArgs)
Handles _mainView.Closing
For Each frm As Form In _mainView.MdiChildren
frm.Close()
Next
End Sub
TIA
Ron L
P.S. sorry for the cross-post, I forgot to add these groups before I clicked
send. DOH!
which could have data in a state that needs to be saved. Each child window
catches its Closing event and cancels it if the user wants to save the data,
but when the Application closes this event isn't thrown automatically. I
added a loop to close each child window, but can't seem find how to catch
the child window's cancel of the Closing event, so even if the user selects
cancel to the closing event the application closes anyway. Can anyone point
me in the right direction here?
Here is my application closing handler which closes each child window:
' Catch the application exit event and gracefully close all MDI child
windows
Private Sub ApplicationExiting(ByVal sender As System.Object, _
ByVal e As System.ComponentModel.CancelEventArgs)
Handles _mainView.Closing
For Each frm As Form In _mainView.MdiChildren
frm.Close()
Next
End Sub
TIA
Ron L
P.S. sorry for the cross-post, I forgot to add these groups before I clicked
send. DOH!