From fc445d0da9e051e700628edbc1aebd0f28217411 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 16 Aug 2006 21:38:16 +0000 Subject: [PATCH] * MdiWindowManager.cs: Do this closing cleanup in a Closed handler, instead of when the button is clicked, so cancelling the close works correctly. svn path=/trunk/mcs/; revision=63853 --- mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 3 +++ .../Managed.Windows.Forms/System.Windows.Forms/MdiWindowManager.cs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 6608089f5db..384c99b2d90 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -3,6 +3,9 @@ * Form.cs: Fire the closing events for all the mdi child windows when a window is closed. If the cancel args are set to true, the main window still gets the event fired, but it doesn't not close. + * MdiWindowManager.cs: Do this closing cleanup in a Closed + handler, instead of when the button is clicked, so cancelling the + close works correctly. 2006-08-16 Carlos Alberto Cortez diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiWindowManager.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiWindowManager.cs index dda65bddf37..d30dc6ca698 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiWindowManager.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiWindowManager.cs @@ -56,7 +56,7 @@ namespace System.Windows.Forms { prev_bounds = form.Bounds; prev_window_state = form.window_state; form.GotFocus += new EventHandler (FormGotFocus); - + form.Closed += new EventHandler (FormClosed); draw_maximized_buttons = new PaintEventHandler (DrawMaximizedButtons); CreateIconMenus (); } @@ -281,7 +281,7 @@ namespace System.Windows.Forms { form.WindowState = FormWindowState.Maximized; } - protected override void CloseClicked (object sender, EventArgs e) + private void FormClosed (object sender, EventArgs e) { mdi_container.CloseChildForm (form); if (form.WindowState == FormWindowState.Maximized) -- 2.11.4.GIT