Skip to content

Commit fcf3868

Browse files
danAtAllworxtdykstra
authored andcommitted
ThreadException only accepts one handler (#3108)
Cross-reference https://stackoverflow.com/q/57717007/3119991
1 parent abb8ec6 commit fcf3868

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

xml/System.Windows.Forms/Application.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1789,13 +1789,16 @@ The high DPI mode is set once per process. For more information about setting th
17891789
<format type="text/markdown"><![CDATA[
17901790
17911791
## Remarks
1792-
This event allows your Windows Forms application to handle otherwise unhandled exceptions that occur in Windows Forms threads. Attach your event handlers to the <xref:System.Windows.Forms.Application.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.
1792+
This event allows your Windows Forms application to handle otherwise unhandled exceptions that occur in Windows Forms threads. Attach your event handler to the <xref:System.Windows.Forms.Application.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.
17931793
17941794
You can change whether this callback is used for unhandled Windows Forms thread exceptions by setting <xref:System.Windows.Forms.Application.SetUnhandledExceptionMode%2A>. To catch exceptions that occur in threads not created and owned by Windows Forms, use the <xref:System.AppDomain.UnhandledException> event handler.
17951795
17961796
> [!NOTE]
17971797
> To guarantee that no activations of this event are missed, you must attach a handler before you call <xref:System.Windows.Application.Run%2A?displayProperty=nameWithType>.
17981798
1799+
> [!NOTE]
1800+
> Only one handler can be attached to this event. If multiple handlers are added, only the most recently added handler will be called on an unhandled exception.
1801+
17991802
> [!CAUTION]
18001803
> Because this is a static event, you must detach your event handlers when your application is disposed, or memory leaks will result.
18011804

0 commit comments

Comments
 (0)