Event ThreadException
Occurs when an untrapped thread exception is thrown.
public static event ThreadExceptionEventHandler? ThreadException
Returns
- ThreadExceptionEventHandler
- Occurs when an untrapped thread exception is thrown.
Remarks
This event allows your application to handle otherwise unhandled exceptions that occur in UI threads. Attach your event handler to the ThreadException event to deal with these exceptions, which will leave your application in an unknown state. Where possible, exceptions should be handled by a structured exception handling block. You can change whether this callback is used for unhandled Windows Forms thread exceptions by setting SetUnhandledExceptionMode(UnhandledExceptionMode).