Provides data for the ThreadException event.
Assembly: System (in System.dll)
Initializes a new instance of theclass.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Serves as the default hash function. (Inherited from Object.)
Returns a string that represents the current object.(Inherited from Object.)
A Exception that occurred.is created by a thread when an unhandled exception occurs. contains the
The following example allows you to raise a ThreadException event by clicking button1 on a form. The example creates two classes. The ErrorHandler class creates the form and the button that raises the event. The CustomExceptionHandler class provides the methods to handle the exception.
In Main in the ErrorHandler class, the code creates a new instance of the exception handling class, that is, an instance of the CustomExceptionHandler. Then the instance is added to the event, and the application is run.
In the OnThreadException method in the CustomExceptionHandler class, the example uses a try...catch...finally statement to process the exception. The ShowThreadExceptionDialog method creates the message to display, and displays it in a message box.
Available since 1.1
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.