You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@${issueAuthor} - This PR edits files whose 'source of truth' for documentation is not in this repo. If you're editing the documentation, please make these updates in the /// comments in the source repo (either dotnet/runtime or dotnet/extensions) instead.
Copy file name to clipboardExpand all lines: xml/System.Windows.Forms/Control.xml
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8235,7 +8235,12 @@ MyControl.Font = New Font(MyControl.Font, _
8235
8235
> [!NOTE]
8236
8236
> In addition to the <xref:System.Windows.Forms.Control.InvokeRequired%2A> property, there are four methods on a control that are thread safe: <xref:System.Windows.Forms.Control.Invoke%2A>, <xref:System.Windows.Forms.Control.BeginInvoke%2A>, <xref:System.Windows.Forms.Control.EndInvoke%2A>, and <xref:System.Windows.Forms.Control.CreateGraphics%2A> if the handle for the control has already been created. Calling <xref:System.Windows.Forms.Control.CreateGraphics%2A> before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread.
8237
8237
8238
-
The delegate can be an instance of <xref:System.EventHandler>, in which case the sender parameter will contain this control, and the event parameter will contain <xref:System.EventArgs.Empty?displayProperty=nameWithType>. The delegate can also be an instance of <xref:System.Windows.Forms.MethodInvoker>, or any other delegate that takes a void parameter list. A call to an <xref:System.EventHandler> or <xref:System.Windows.Forms.MethodInvoker> delegate will be faster than a call to another type of delegate.
8238
+
The delegate can be an instance of <xref:System.EventHandler>, in which case the parameters will depend on the `args` value:
8239
+
- If no parameters are passed, the sender parameter will contain this control and the event parameter will contain <xref:System.EventArgs.Empty?displayProperty=nameWithType>.
8240
+
- When a single parameter is passed, the sender parameter will contain the first args element and the event parameter will contain <xref:System.EventArgs.Empty?displayProperty=nameWithType>.
8241
+
- If more than one parameter is passed, the sender parameter will contain the first element from `args`, and the <xref:System.EventArgs> parameter will contain the second element.
8242
+
8243
+
A call to an <xref:System.EventHandler> or <xref:System.Windows.Forms.MethodInvoker> delegate will be faster than a call to another type of delegate.
8239
8244
8240
8245
> [!NOTE]
8241
8246
> An exception might be thrown if the thread that should process the message is no longer active.
0 commit comments