Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions xml/System.Windows.Forms.Integration/WindowsFormsHost.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<a name="xamlObjectElementUsage_WindowsFormsHost"></a>
## XAML Object Element Usage

```
```xaml
<WindowsFormsHost.../>
```

Expand Down Expand Up @@ -168,8 +168,8 @@ The following code example demonstrates how to use a <xref:System.Windows.Forms.
<a name="xamlAttributeUsage_Background"></a>
## XAML Attribute Usage

```
<object Background="Brush"/>
```xaml
<object Background="Brush"/>
```

<a name="xamlValues_Background"></a>
Expand Down Expand Up @@ -350,8 +350,8 @@ The following code example demonstrates how to use a <xref:System.Windows.Forms.
<a name="xamlAttributeUsage_ChildChanged"></a>
## XAML Attribute Usage

```
<object ChildChanged="eventHandler"/>
```xaml
<object ChildChanged="eventHandler"/>
```

]]></format>
Expand Down Expand Up @@ -503,8 +503,8 @@ The following code example demonstrates how to use a <xref:System.Windows.Forms.
<a name="xamlAttributeUsage_FontFamily"></a>
## XAML Attribute Usage

```
<object FontFamily="fontFamily"/>
```xaml
<object FontFamily="fontFamily"/>
```

<a name="xamlValues_FontFamily"></a>
Expand Down Expand Up @@ -589,8 +589,8 @@ The following code example demonstrates how to use a <xref:System.Windows.Forms.
<a name="xamlAttributeUsage_FontSize"></a>
## XAML Attribute Usage

```
<object FontSize="double"/>
```xaml
<object FontSize="double"/>
```

<a name="xamlValues_FontSize"></a>
Expand Down Expand Up @@ -673,8 +673,8 @@ The following code example demonstrates how to use a <xref:System.Windows.Forms.
<a name="xamlAttributeUsage_FontStyle"></a>
## XAML Attribute Usage

```
<object FontStyle="fontStyle"/>
```xaml
<object FontStyle="fontStyle"/>
```

<a name="xamlValues_FontStyle"></a>
Expand Down Expand Up @@ -758,8 +758,8 @@ The following code example demonstrates how to use a <xref:System.Windows.Forms.
<a name="xamlAttributeUsage_FontWeight"></a>
## XAML Attribute Usage

```
<object FontWeight="fontWeight"/>
```xaml
<object FontWeight="fontWeight"/>
```

<a name="xamlValues_FontWeight"></a>
Expand Down Expand Up @@ -843,8 +843,8 @@ The following code example demonstrates how to use a <xref:System.Windows.Forms.
<a name="xamlAttributeUsage_Foreground"></a>
## XAML Attribute Usage

```
<object Foreground="Brush"/>
```xaml
<object Foreground="Brush"/>
```

<a name="xamlValues_Foreground"></a>
Expand Down Expand Up @@ -936,8 +936,8 @@ The following code example demonstrates how to use a <xref:System.Windows.Forms.
<a name="xamlAttributeUsage_LayoutError"></a>
## XAML Attribute Usage

```
<object LayoutError="eventHandler"/>
```xaml
<object LayoutError="eventHandler"/>
```

]]></format>
Expand Down Expand Up @@ -1096,8 +1096,8 @@ The following code example demonstrates how to use a <xref:System.Windows.Forms.
<a name="xamlAttributeUsage_Padding"></a>
## XAML Attribute Usage

```
<object Padding="Thickness"/>
```xaml
<object Padding="Thickness"/>
```

<a name="xamlValues_Padding"></a>
Expand Down Expand Up @@ -1282,8 +1282,8 @@ The following code example demonstrates how to use a <xref:System.Windows.Forms.
<a name="xamlAttributeUsage_TabIndex"></a>
## XAML Attribute Usage

```
<object TabIndex="int"/>
```xaml
<object TabIndex="int"/>
```

<a name="dependencyPropertyInfo_TabIndex"></a>
Expand Down
470 changes: 230 additions & 240 deletions xml/System.Windows.Forms/BindingContext.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions xml/System.Windows.Forms/ComboBox.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1754,9 +1754,9 @@
## Remarks
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:
```
```xml
<appSettings>
  <add key="EnableWindowsFormsHighDpiAutoResizing" value="true" />
<add key="EnableWindowsFormsHighDpiAutoResizing" value="true" />
</appSettings>
```
Expand Down
23 changes: 9 additions & 14 deletions xml/System.Windows.Forms/Control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5557,19 +5557,14 @@ The following table lists Windows Forms controls and which event (<xref:System.W
<format type="text/markdown"><![CDATA[

## Remarks
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>.
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>.

```
```csharp
Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
```

> [!NOTE]
> 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.

For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).



## Examples
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.

Expand Down Expand Up @@ -8488,7 +8483,7 @@ MyControl.Font = New Font(MyControl.Font, _
- If no parameters are passed, the sender parameter will contain this control and the event parameter will contain <xref:System.EventArgs.Empty?displayProperty=nameWithType>.
- 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>.
- 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.

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.

> [!NOTE]
Expand Down Expand Up @@ -8575,11 +8570,11 @@ MyControl.Font = New Font(MyControl.Font, _
<returns>A task that represents the asynchronous invoke operation.</returns>
<remarks>
<para>
When you pass a <see cref="T:System.Threading.CancellationToken" /> to this method, the method will return, but the callback will still be executed.
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. <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.
</para>
<para>
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)" />
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)" />
or <see cref="M:System.Windows.Forms.Control.InvokeAsync``1(System.Func{System.Threading.CancellationToken,System.Threading.Tasks.ValueTask{``0}},System.Threading.CancellationToken)" />.
</para>
</remarks>
Expand Down Expand Up @@ -8716,12 +8711,12 @@ MyControl.Font = New Font(MyControl.Font, _
<remarks>
<para>
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.
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
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
execute short sync running operations in the callback, like updating a control's property or similar.
</para>
<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>
<para>
<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".
<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".
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)" />
or <see cref="M:System.Windows.Forms.Control.InvokeAsync``1(System.Func{System.Threading.CancellationToken,System.Threading.Tasks.ValueTask{``0}},System.Threading.CancellationToken)" />.
</para>
Expand Down Expand Up @@ -17058,7 +17053,7 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
## Remarks
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.

```
```csharp
[assembly: AssemblyProduct("MyApplication")]
```

Expand Down Expand Up @@ -17133,7 +17128,7 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
## Remarks
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.

```
```csharp
[assembly: AssemblyVersion("1.0.1")]
```

Expand Down
Loading