Author: toshok
Date: 2006-11-04 13:28:41 -0500 (Sat, 04 Nov 2006)
New Revision: 67362
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
Log:
2006-11-04 Chris Toshok <[EMAIL PROTECTED]>
* Form.cs: if the form isn't visible, Close() does nothing.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-11-04 18:28:28 UTC (rev 67361)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-11-04 18:28:41 UTC (rev 67362)
@@ -1,3 +1,7 @@
+2006-11-04 Chris Toshok <[EMAIL PROTECTED]>
+
+ * Form.cs: if the form isn't visible, Close() does nothing.
+
2006-11-03 Chris Toshok <[EMAIL PROTECTED]>
* Form.cs (Close): if the form is modal, don't Dispose of it, only
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
2006-11-04 18:28:28 UTC (rev 67361)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
2006-11-04 18:28:41 UTC (rev 67362)
@@ -1167,13 +1167,17 @@
}
public void Close () {
- if (!IsDisposed) {
- XplatUI.SendMessage(this.Handle, Msg.WM_CLOSE,
IntPtr.Zero, IntPtr.Zero);
- if (is_modal)
- Hide ();
- else
- Dispose ();
- }
+ if (IsDisposed)
+ return;
+
+ if (!is_visible)
+ return;
+
+ XplatUI.SendMessage(this.Handle, Msg.WM_CLOSE,
IntPtr.Zero, IntPtr.Zero);
+ if (is_modal)
+ Hide ();
+ else
+ Dispose ();
}
public void LayoutMdi(MdiLayout value) {
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches