System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs)

Here are the examples of the csharp api class System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Example 7

1. Example

Project: Unity-WinForms
Source File: Form.cs
View license
internal void CloseInternal(CloseReason closeReason)
        {
            var closingEventArgs = new FormClosingEventArgs(closeReason, false);

            OnFormClosing(closingEventArgs);

            if (!closingEventArgs.Cancel)
            {
                var closedEventArgs = new FormClosedEventArgs(closeReason);
                OnFormClosed(closedEventArgs);
                Dispose();
            }

            // Invoke dialog result action.
            if (dialog && dialogCallback != null)
                dialogCallback.Invoke(this, DialogResult);
        }