Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 1.1
.NET Framework
Reference
Class Library
Application Class
Events
 ThreadExit Event
This page is specific to
Microsoft Visual Studio 2003/.NET Framework 1.1

Other versions are also available for the following:
.NET Framework Class Library
Application.ThreadExit Event

Occurs when a thread is about to shut down. When the main thread for an application is about to be shut down, this event is raised first, followed by an ApplicationExit event.

[Visual Basic]
Public Shared Event ThreadExit As EventHandler
[C#]
public static event EventHandler ThreadExit;
[C++]
public: static __event EventHandler* ThreadExit;

[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.

Remarks

You must attach the event handlers to the ThreadExit event to perform any unhandled, required tasks before the thread stops running. Close files opened by this thread, or dispose of objects that the garbage collector did not reclaim.

Requirements

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 | ExitThread

© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker