The differences between FormClosing and FormClosed in C are explained in detail

  • 2020-05-19 05:40:34
  • OfStack

FormClosing event

The FormClosing event occurs when the form closes. This event will be handled. This frees up all resources associated with the form.

If this event is cancelled, the form remains open.

When the form appears as a modal dialog, clicking close hides the form and sets the DialogResult property to Cancel.

By setting the DialogResult property in these events, you can override the value of DialogResult when the user clicks the close button in the upper right corner.

FormClosed event

An FormClosed event occurs after the user or the Close method of the Application class or the Exit method closes the form.

You can use this event to release some resources from the form. You can also use this event to save some information from the input form or to update the parent form.


Related articles: