Posted 20 years ago
by tobias weltner

When I call "CloseAllActiveDocuments" in response to a form close event, all child docs are closing...good.
However, if the user cancels the close by pressing Cancel in the WindowClosing event (setting e.Cancel to true), this child window will not close BUT the closing process itself continues to close the remaining child windows.
Would it be possible to add a cancel method for the CloseAllActiveDocuments-process? Or would I have to replace CloseAllActiveDocuments with a loop and closing the child docs manually one by one? I tried this, too, but since closing a doc will modify the document collection, I cannot use a loop.
In other words, which is the best way to close all documents while still allowing the user to cancel the operation?
Thanx!
However, if the user cancels the close by pressing Cancel in the WindowClosing event (setting e.Cancel to true), this child window will not close BUT the closing process itself continues to close the remaining child windows.
Would it be possible to add a cancel method for the CloseAllActiveDocuments-process? Or would I have to replace CloseAllActiveDocuments with a loop and closing the child docs manually one by one? I tried this, too, but since closing a doc will modify the document collection, I cannot use a loop.
In other words, which is the best way to close all documents while still allowing the user to cancel the operation?
Thanx!