Occurs when an untrapped thread exception is thrown.
The following declaration shows the syntax for a method that handles the ThreadException event.
[Visual Basic] Private Sub ApplicationName_ThreadException( _ ByVal sender As Object, _ ByVal e As ThreadExceptionEventArgs _ ) [C#] private void ApplicationName_ThreadException( object sender, ThreadExceptionEventArgs e ); [C++] private: void ApplicationName_ThreadException( Object* sender, ThreadExceptionEventArgs* e ); [JScript] private ApplicationName_ThreadException( sender : Object, e : ThreadExceptionEventArgs );
This event allows an application to intelligently handle an exception. It is called by a window procedure when it receives a thread exception. You should attach your event-handling methods to the System.WinForms.Application.ThreadException event to deal with the exception. An appropriate event-handling method will not terminate the thread, and allow your application to continue executing.
Application Class | Application MembersTopic | System.WinForms Namespace