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
Copy file name to clipboardExpand all lines: xml/System.Windows.Forms/ComboBox.xml
+2-2
Original file line number
Diff line number
Diff line change
@@ -1754,9 +1754,9 @@
1754
1754
## Remarks
1755
1755
Starting with the .NET Framework 4.5.2, if the <xref:System.Windows.Forms.ComboBox.FlatStyle%2A> property is set to <xref:System.Windows.Forms.FlatStyle.Flat> or <xref:System.Windows.Forms.FlatStyle.Popup>, the drop-down arrow may be resized. Resizing is determined by the system DPI setting when the app.config file contains the following entry:
Copy file name to clipboardExpand all lines: xml/System.Windows.Forms/Control.xml
+9-14
Original file line number
Diff line number
Diff line change
@@ -5557,19 +5557,14 @@ The following table lists Windows Forms controls and which event (<xref:System.W
5557
5557
<format type="text/markdown"><![CDATA[
5558
5558
5559
5559
## Remarks
5560
-
The <xref:System.Windows.Forms.DragEventArgs.X%2A> and <xref:System.Windows.Forms.DragEventArgs.Y%2A> properties of the <xref:System.Windows.Forms.DragEventArgs> are in screen coordinates, not client coordinates. The following line of Visual C# code converts the properties to a client <xref:System.Drawing.Point>.
5560
+
The <xref:System.Windows.Forms.DragEventArgs.X%2A> and <xref:System.Windows.Forms.DragEventArgs.Y%2A> properties of the <xref:System.Windows.Forms.DragEventArgs> are in screen coordinates, not client coordinates. The following line of code converts the properties to a client <xref:System.Drawing.Point>.
5561
5561
5562
-
```
5562
+
```csharp
5563
5563
Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
5564
5564
```
5565
5565
5566
-
> [!NOTE]
5567
-
> In versions earlier than .NET Framework 2.0, if you put a <xref:System.Windows.Forms.UserControl> with <xref:System.Windows.Forms.Control.DragEnter> and <xref:System.Windows.Forms.Control.DragDrop> events on a Windows Form and drag and drop something onto the <xref:System.Windows.Forms.UserControl> at design time, the `DropDrop` and `DropEnter` events are raised. However, when you close and reopen the solution, the <xref:System.Windows.Forms.Control.DragEnter> and <xref:System.Windows.Forms.Control.DragDrop> events are not raised again.
5568
-
5569
5566
For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
5570
5567
5571
-
5572
-
5573
5568
## Examples
5574
5569
This code excerpt demonstrates using the <xref:System.Windows.Forms.Control.DragDrop> event. See the <xref:System.Windows.Forms.Control.DoDragDrop%2A> method for the complete code example.
5575
5570
@@ -8488,7 +8483,7 @@ MyControl.Font = New Font(MyControl.Font, _
8488
8483
- If no parameters are passed, the sender parameter will contain this control and the event parameter will contain <xref:System.EventArgs.Empty?displayProperty=nameWithType>.
8489
8484
- 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>.
8490
8485
- 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.
8491
-
8486
+
8492
8487
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.
8493
8488
8494
8489
> [!NOTE]
@@ -8575,11 +8570,11 @@ MyControl.Font = New Font(MyControl.Font, _
8575
8570
<returns>A task that represents the asynchronous invoke operation.</returns>
8576
8571
<remarks>
8577
8572
<para>
8578
-
When you pass a <see cref="T:System.Threading.CancellationToken" /> to this method, the method will return, but the callback will still be executed.
8573
+
When you pass a <see cref="T:System.Threading.CancellationToken" /> to this method, the method will return, but the callback will still be executed.
8579
8574
The callback will be running on the UI thread and will be also blocking the UI thread. <c>InvokeAsync</c> in this case is just queuing the callback to the end of the message queue and returns immediately, but as soon as the callback gets executed, it will still block the UI thread for the time it is running. For this reason, it is recommended to only execute short sync running operations in the callback, like updating a control's property or similar.
8580
8575
</para>
8581
8576
<para>
8582
-
If you want to execute a long-running operation, consider using asynchronous callbacks instead, by making sure that you use either the overload <see cref="M:System.Windows.Forms.Control.InvokeAsync(System.Func{System.Threading.CancellationToken,System.Threading.Tasks.ValueTask},System.Threading.CancellationToken)" />
8577
+
If you want to execute a long-running operation, consider using asynchronous callbacks instead, by making sure that you use either the overload <see cref="M:System.Windows.Forms.Control.InvokeAsync(System.Func{System.Threading.CancellationToken,System.Threading.Tasks.ValueTask},System.Threading.CancellationToken)" />
8583
8578
or <see cref="M:System.Windows.Forms.Control.InvokeAsync``1(System.Func{System.Threading.CancellationToken,System.Threading.Tasks.ValueTask{``0}},System.Threading.CancellationToken)" />.
8584
8579
</para>
8585
8580
</remarks>
@@ -8716,12 +8711,12 @@ MyControl.Font = New Font(MyControl.Font, _
8716
8711
<remarks>
8717
8712
<para>
8718
8713
When you pass a <see cref="T:System.Threading.CancellationToken" /> to this method, the method will return, but the callback will still be executed. The callback will be running on the UI thread and will be also blocking the UI thread.
8719
-
InvokeAsync in this case is just queuing the callback to the end of the message queue and returns immediately, but as soon as the callback is executed, it will still block the UI for the time it is running. For this reason, it is recommended to only
8714
+
InvokeAsync in this case is just queuing the callback to the end of the message queue and returns immediately, but as soon as the callback is executed, it will still block the UI for the time it is running. For this reason, it is recommended to only
8720
8715
execute short sync running operations in the callback, like updating a control's property or similar.
8721
8716
</para>
8722
8717
<para>If you want to execute a long-running operation, consider using asynchronous callbacks instead, which you use with the overloads of <c>InvokeAsync</c> described below.</para>
8723
8718
<para>
8724
-
<b>Important:</b> Also note that if you use this overload to pass a callback which returns a <see cref="T:System.Threading.Tasks.Task" /> that this Task will NOT be awaited but return immediately and has the characteristics of an "engage-and-forget".
8719
+
<b>Important:</b> Also note that if you use this overload to pass a callback which returns a <see cref="T:System.Threading.Tasks.Task" /> that this Task will NOT be awaited but return immediately and has the characteristics of an "engage-and-forget".
8725
8720
If you want the task which you pass to be awaited, make sure that you use either the overload <see cref="M:System.Windows.Forms.Control.InvokeAsync(System.Func{System.Threading.CancellationToken,System.Threading.Tasks.ValueTask},System.Threading.CancellationToken)" />
8726
8721
or <see cref="M:System.Windows.Forms.Control.InvokeAsync``1(System.Func{System.Threading.CancellationToken,System.Threading.Tasks.ValueTask{``0}},System.Threading.CancellationToken)" />.
8727
8722
</para>
@@ -17058,7 +17053,7 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
17058
17053
## Remarks
17059
17054
The <xref:System.Windows.Forms.Control.ProductName%2A> property is a read-only property. To change the value of this property, set the <xref:System.Reflection.AssemblyProductAttribute.Product%2A> property value of the <xref:System.Reflection.AssemblyProductAttribute>. The following line of C# code sets the <xref:System.Windows.Forms.Control.ProductName%2A> property.
17060
17055
17061
-
```
17056
+
```csharp
17062
17057
[assembly: AssemblyProduct("MyApplication")]
17063
17058
```
17064
17059
@@ -17133,7 +17128,7 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
17133
17128
## Remarks
17134
17129
The <xref:System.Windows.Forms.Control.ProductVersion%2A> property is a read-only property. To change the value of this property, set the <xref:System.Reflection.AssemblyVersionAttribute.Version%2A> property value of the <xref:System.Reflection.AssemblyVersionAttribute>. The following line of C# code sets the <xref:System.Windows.Forms.Control.ProductVersion%2A> property.
0 commit comments