This documentation is archived and is not being maintained.

Application.ApplicationExit Event

Occurs when the application is about to shut down.

[Visual Basic]
Public Shared Event ApplicationExit As EventHandler
public static event EventHandler ApplicationExit;
public: static __event EventHandler* ApplicationExit;

[JScript] In JScript, you can handle the events defined by a class, but you cannot define your own.

Event Data

The event handler receives an argument of type EventArgs.


You must attach the event handlers to the Exit event to perform unhandled, required tasks before the application stops running. You can close files opened by this application, or dispose of objects that garbage collection did not reclaim.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Application Class | Application Members | System.Windows.Forms Namespace | Exit