Occurs when the application is about to shut down.
The following declaration shows the syntax for a method that handles the ApplicationExit event.
[Visual Basic] Private Sub ApplicationName_ApplicationExit( _ ByVal sender As Object, _ ByVal e As EventArgs _ ) [C#] private void ApplicationName_ApplicationExit( object sender, EventArgs e ); [C++] private: void ApplicationName_ApplicationExit( Object* sender, EventArgs* e ); [JScript] private ApplicationName_ApplicationExit( sender : Object, e : EventArgs );
Property | Description |
---|---|
|
You should attach the event-handling methods to the Exit event to perform any unhandled, required tasks before the application stops running. You can close any files opened by this application, or dispose objects that were not reclaimed by garbage collection.
Application Class | Application MembersTopic | System.WinForms Namespace