Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[fix] #631810: Form.DialogResult needs to call its close events *befo…

…re* closing.

	* Form.cs: When setting DialogResult call RaiseCloseEvents
	instead of directly setting 'closing', since we need to have our
	FormClosing event invoked *before* the form dissapears, so the
	user can properly cancel the close operation if desired.
	Fixes #631810.
  • Loading branch information...
commit cc39d7ebf1bfa8fafd6adc3a9fda354672579d1c 1 parent b407092
Carlos Alberto Cortez carlosalberto authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
3  mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
View
@@ -708,7 +708,8 @@ internal bool ShouldSerializeAutoSize ()
typeof (DialogResult));
dialog_result = value;
- closing = (dialog_result != DialogResult.None && is_modal);
+ if (dialog_result != DialogResult.None && is_modal)
+ RaiseCloseEvents (false, false); // .Net doesn't send WM_CLOSE here.
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.