System.Windows.Forms.Application.Exit Method

Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed.

Syntax

public static void Exit ()

Remarks

The Application.Exit method stops all running message loops on all threads and closes all windows of the application. This method does not necessarily force the application to exit. The Application.Exit method is typically called from within a message loop, and forces Application.Run to return. To exit a message loop for the current thread only, call Application.ExitThread.

Application.Exit raises the following events and performs the associated conditional actions:

Note:

The Application.Exit method does not raise the Form.Closed and Form.Closing events, which are obsolete as of dnprdnlong.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0