FormClosing vs. WindowClosing: Who should go first?

Docking/MDI for Windows Forms Forum

Posted 17 years ago by Anthony Martin
Version: 2.0.75
I have event handlers for mainForm.FormClosing and dockmanager.WindowClosing.

When I close a DocumentWindow, I dispose of it. TabbedMdiWindowCloseReason = User

When I close the main form using the "X" in the upper right, DocumentWindows start closing (TabbedMdiWindowCloseReason = User) before the FormClosing event is handled and I give an "Are you sure?" message. If the user presses "Cancel", my document windows are already gone.

Is there a way to either get the mainForm.FormClosing handler to go first or to add a new TabbedMdiWindowCloseReason, Form?

Comments (1)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Anthony,

When I try in the DockForm sample, I get a TabbedMdiWindowCloseReason.Programmatic when the big parent Form's X is clicked. Can you try the latest maintenance release and let me know if you see differently?

Actipro Software Support

The latest build of this product (v23.1.2) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.