In VB.NET
what is the difference between FormClosed
and FormClosing
event?
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
FormClosing
happens before FormClosed
. Think of FormClosing
like the dialog that ask you to save your document before quitting the program. It gives you an opportunity to cancel the window's termination.
FormClosed
is triggered after the form has closed. From MS documentation:
The FormClosed event occurs after the form has been closed by the user or by the Close method or the Exit method of the Application class. To prevent a form from closing, handle the FormClosing event and set the Cancel property of the CancelEventArgs passed to your event handler to true.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With