Difference between FormClosed and FormClosing event

In VB.NETwhat is the difference between events FormClosedand FormClosing?

Private Sub frmTerminal_TCP_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing

End Sub


Private Sub frmTerminal_TCP_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed

End Sub
+4
source share
1 answer

FormClosingoccurs before FormClosed. Think about FormClosinghow in the dialog box in which you are asked to save the document before exiting the program. This gives you the ability to undo window termination.

FormClosedstarts after closing the form. From MS Documentation :

FormClosed , Close Exit Application. , FormClosing CancelEventArgs true.

+8

Source: https://habr.com/ru/post/1610668/


All Articles