December 2001
Beginner
976 pages
22h 4m
English
It is a common case that you would want to write code that is executed when the form closes. The Closed Event is sent to a form after the form is closed, and the form can handle this event if it has an OnClosed method. The OnClosed method is automatically called on a form if a Closed Event is fired for that form.
Here is a sample OnClosed method that shows where you would put your application logic, which is executed when the form is closed:
Protected Overrides Sub OnClosed(ByVal e As System.EventArgs)
MyBase.OnClosed
'Add code here
End Sub
After this method is called, the form is about to be closed, and there is no turning back. What if you wanted to write code to validate the form before it was closed? And, if the form is not ...
Read now
Unlock full access