ExitThread Method

Application.ExitThread Method ()


Exits the message loop on the current thread and closes all windows on the thread.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public static void ExitThread()

Use this method to exit the message loop of the current thread. This method causes the call to Run for the current thread to return. To exit the entire application, call Exit.


for the immediate caller to call unmanaged code. Associated enumeration: SecurityPermissionFlag.UnmanagedCode

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft