From: Miguel de Icaza Date: Thu, 10 Feb 2011 23:54:13 +0000 (-0500) Subject: [bugfix: 664695] Calling Dispose on ToolStrip emit events. Doesn't on .NET X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=82a3eedf58cb2a3ee6f6870c235ea34e7310af6c;p=mono.git [bugfix: 664695] Calling Dispose on ToolStrip emit events. Doesn't on .NET --- diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs index f77f6c1f9f1..ebf99667a65 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs @@ -2221,7 +2221,10 @@ namespace System.Windows.Forms { return true; } else if (accept_button != null) { - accept_button.PerformClick(); + // Set ActiveControl to force any Validation to take place. + ActiveControl = (accept_button as Control); + if (ActiveControl == accept_button) // else Validation failed + accept_button.PerformClick(); return true; } } else if (keyData == Keys.Escape && cancel_button != null) {