Skip to content

Commit e35c560

Browse files
adegeogewarren
andauthored
What's new for RC1 (#2122)
* Update compiler errors * add code for darkmode * Clean up wording related to .NET RC * Minor * Fix or * Rewrite info * Apply suggestions from code review Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --------- Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
1 parent 18b6b5d commit e35c560

File tree

20 files changed

+576
-29
lines changed

20 files changed

+576
-29
lines changed

dotnet-desktop-guide/winforms/compiler-messages/wfo5001.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Compiler Error WFO5001
33
description: Learn more about compiler error WFO5001. 'ColorMode' is for evaluation purposes only and subject to change.
4-
ms.date: 03/04/2025
4+
ms.date: 09/09/2025
55
ms.service: dotnet-desktop
66
ms.update-cycle: 365-days
77
f1_keywords:
@@ -16,12 +16,15 @@ helpviewer_keywords:
1616

1717
> `System.Windows.Forms.Application.SetColorMode(System.Windows.Forms.SystemColorMode)` is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
1818
19-
-or-
19+
—or—
2020

2121
> `System.Windows.Forms.SystemColorMode` is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
2222
2323
The color mode feature is currently experimental and subject to change. This error is generated so that you understand the implications of writing code that sets the color mode of the Windows Forms project. The error must be suppressed to continue. For more information about this API, see [Dark mode](../whats-new/net90.md#dark-mode).
2424

25+
> [!NOTE]
26+
> This compiler error no longer applies starting with .NET 10.
27+
2528
## Example
2629

2730
The following sample generates WFO5001:
@@ -43,6 +46,10 @@ static class Program
4346

4447
## To correct this error
4548

49+
Upgrade to .NET 10 or later, where this feature is no longer considered experimental.
50+
51+
\- or -
52+
4653
Suppress the error and enable access to the API by either of the following methods:
4754

4855
- Set the severity of the rule in the _.editorConfig_ file.

dotnet-desktop-guide/winforms/compiler-messages/wfo5002.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Compiler Error WFO5002
33
description: Learn more about compiler error WFO5002. Async is for evaluation purposes only and subject to change.
4-
ms.date: 03/04/2025
4+
ms.date: 09/10/2025
55
ms.service: dotnet-desktop
66
ms.update-cycle: 365-days
77
f1_keywords:
@@ -24,6 +24,9 @@ This compiler error is generated when using any of the following methods:
2424

2525
The Windows Forms asynchronous API is currently experimental and subject to change. This error is generated so that you understand the implications of writing code that uses these APIs. The error must be suppressed to continue. For more information about this API, see [Async forms](../whats-new/net90.md#async-forms).
2626

27+
> [!NOTE]
28+
> This compiler error no longer applies starting with .NET 10.
29+
2730
## Example
2831

2932
The following sample generates WFO5002:
@@ -38,6 +41,10 @@ private async void button1_Click(object sender, EventArgs e)
3841

3942
## To correct this error
4043

44+
Upgrade to .NET 10 or later, where this feature is no longer considered experimental.
45+
46+
—or—
47+
4148
Suppress the error and enable access to the API by either of the following methods:
4249

4350
- Set the severity of the rule in the _.editorConfig_ file.

dotnet-desktop-guide/winforms/whats-new/index.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: What's new in Windows Forms
33
description: Learn about what's new in Windows Forms. This article covers changes to Windows Forms since .NET 5 was released.
4-
ms.date: 03/17/2025
4+
ms.date: 09/09/2025
55
ms.service: dotnet-desktop
66
ms.update-cycle: 365-days
77
ms.topic: conceptual
@@ -12,12 +12,18 @@ ai-usage: ai-assisted
1212

1313
Each .NET release introduces a new version of Windows Forms (WinForms). This article gives you a summery of what's new in each release.
1414

15-
## .NET 10 Preview
15+
## .NET 10 Release Candidate
1616

17-
This section describes the main changes to WinForms for .NET 10 Preview.
17+
This section describes the main changes to WinForms for .NET 10 Release Candidate.
1818

19+
- [Overview of Windows Forms on .NET 10](net100.md)
1920
- [Clipboard changes](net100.md#clipboard-changes)
21+
- [Async forms](net100.md#async-forms)
2022
- [Custom designer improvements](net100.md#custom-designer-improvements)
23+
- [Dark mode](net100.md#dark-mode)
24+
- [Accessibility](net100.md#accessibility)
25+
- [ScreenCaptureMode API](net100.md#screencapturemode-api)
26+
- [Analyzer improvements](net100.md#analyzer-improvements)
2127

2228
## .NET 9
2329

dotnet-desktop-guide/winforms/whats-new/net100.md

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
---
2-
title: What's new in WinForms for .NET 10 Preview
3-
description: Learn about what's new in Windows Forms for .NET 10 Preview. New versions of Windows Forms are released yearly with .NET.
2+
title: What's new in WinForms for .NET 10 Release Candidate
3+
description: Learn about what's new in Windows Forms for .NET 10 Release Candidate. New versions of Windows Forms are released yearly with .NET.
44
ms.topic: whats-new
5-
ms.date: 08/12/2025
5+
ms.date: 09/09/2025
66
ms.service: dotnet-desktop
77
ms.update-cycle: 365-days
8+
dev_langs:
9+
- "csharp"
10+
- "vb"
811
#customer intent: As a developer, I want to know what's changed so that I can remain up-to-date.
912
---
1013

11-
# What's new in Windows Forms for .NET 10 Preview
14+
# What's new in Windows Forms for .NET 10 Release Candidate
1215

13-
This article provides a high-level overview about what's new with Windows Forms (WinForms) in .NET 10 Preview. For detailed information, see the [release announcements](#release-announcements).
16+
This article provides a high-level overview about what's new with Windows Forms (WinForms) in .NET 10 Release Candidate. For detailed information, see the [release announcements](#release-announcements).
1417

15-
.NET 10 Preview 7 was released in August 2025.
18+
.NET 10 RC 1 was released in September 2025.
1619

1720
## Release announcements
1821

1922
Each release announcement provides detailed information about Windows Forms changes for .NET 10:
2023

24+
- [.NET 10 RC1](https://aka.ms/dotnet/10/rc1)
2125
- [.NET 10 Preview 7](https://aka.ms/dotnet/10/preview7)
2226
- [.NET 10 Preview 6](https://aka.ms/dotnet/10/preview6)
2327
- [.NET 10 Preview 5](https://aka.ms/dotnet/10/preview5)
@@ -32,6 +36,18 @@ Windows Forms is shipping new code for the clipboard API. The clipboard is redes
3236

3337
.NET 9 obsoleted `BinaryFormatter`, which is used in some clipboard operations. These clipboard operations required you to opt in to compatibility package, or work around the operation. To ease the pain of moving away from `BinaryFormatter`, .NET 10 is obsoleting certain clipboard methods to indicate that they shouldn't be used. More methods are being added to help JSON serialization with clipboard data, circumventing the need for `BinaryFormatter`.
3438

39+
## Async forms
40+
41+
Windows Forms has fully integrated asynchronous forms support. Additionally, the async task now has a weak reference to the form, enabling responsive UIs when managing multiple windows.
42+
43+
Windows Forms for .NET 9 introduced new methods to support displaying forms and dialogs asynchronously, but in an opt-in preview mode where you had to suppress [Compiler Error WFO5002](../compiler-messages/wfo5002.md) to use the feature. This compiler error is no longer triggered with .NET 10.
44+
45+
The following APIs are no longer considered experimental:
46+
47+
- <xref:System.Windows.Forms.Form.ShowAsync(System.Windows.Forms.IWin32Window)?displayProperty=nameWithType>
48+
- <xref:System.Windows.Forms.Form.ShowDialogAsync*?displayProperty=nameWithType>
49+
- <xref:System.Windows.Forms.TaskDialog.ShowDialogAsync*?displayProperty=nameWithType>
50+
3551
## Custom designer improvements
3652

3753
Several <xref:System.Drawing.Design.UITypeEditor> types have been ported from .NET Framework, including `ToolStripCollectionEditor` and several editors related to the <xref:System.Windows.Forms.DataGridView> control. These editors are now discoverable by the <xref:System.Windows.Forms.PropertyGrid> and the Windows Forms Designer Actions panel.
@@ -40,18 +56,20 @@ SnapLines were fixed for custom designers.
4056

4157
## Dark mode
4258

43-
Windows Forms for .NET 9 introduced preliminary dark mode visual styling, with the goal of completing implementation in .NET 10.
59+
Windows Forms has fully integrated dark mode support.
60+
61+
Windows Forms for .NET 9 introduced preliminary dark mode visual styling, but in an opt-in preview mode where you had to suppress [Compiler Error WFO5001](../compiler-messages/wfo5001.md) to use the feature. This feature is no longer guarded behind this compiler error starting with .NET 10.
62+
63+
The <xref:System.Windows.Forms.Application.SetColorMode(System.Windows.Forms.SystemColorMode)?displayProperty=nameWithType> API is no longer considered experimental.
4464

45-
- `ListView` column headers are now working.
46-
- `StatusStrip` and `ToolStrip` render correctly.
47-
- Buttons with `FlatStyle` set to `Standard` also render correctly.
48-
- `ComboBox` and `RichTextBox` now render correctly when disabled.
65+
## Clarification on ControlStyles `ApplyThemingImplicitly` usage
4966

50-
However, `RichTextBox` has a rendering issue when it's disabled. If the `RichTextBox` has formatted content, only the first few visible lines appear correctly, and the formatting might not fully apply in the disabled state. To workaround this issue, set it to read-only and manually disable selections.
67+
Controls follow color mode set for the application, dark or light. However, there might be a case where you're composing and drawing your own controls, yet use existing Win32 common controls, such as the scroll bar. These controls remain light colored unless you opt in to applying the theme before the `CreateParams` property is read. There also might be a case where you inherit a control that already follows the theming, and you want to opt out so that you fully control the drawing, such as with a Button.
5168

52-
- `PropertyGrid` special buttons (ellipsis and drop-down) now render consistently in dark mode.
69+
Regardless of your use case, override the <xref:System.Windows.Forms.Control.CreateParams?displayProperty=nameWithType> property, and call [`SetStyle(ControlStyles.ApplyThemingImplicitly, true)`](xref:System.Windows.Forms.ControlStyles.ApplyThemingImplicitly?displayProperty=nameWithType) (opt-in) or [`SetStyle(ControlStyles.ApplyThemingImplicitly, false)`](xref:System.Windows.Forms.ControlStyles.ApplyThemingImplicitly?displayProperty=nameWithType) (opt-out) before the parameters are read from the base class. You **cannot** set this style in your constructor. The base constructor reads the `CreateParams` property before calling your constructor. The following code snippet shows how to opt in:
5370

54-
- Many other fixes for color issues with dark mode.
71+
:::code language="csharp" source="./snippets/net100/csharp/CustomControl1.cs" id="CreateParams":::
72+
:::code language="vb" source="./snippets/net100/vb/CustomControl1.vb" id="CreateParams":::
5573

5674
## Bug fixes
5775

dotnet-desktop-guide/winforms/whats-new/snippets/net100/csharp/CustomControl1.Designer.cs

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
namespace WinFormsApp3;
2+
3+
// <CreateParams>
4+
public partial class CustomControl1 : Control
5+
{
6+
protected override CreateParams CreateParams
7+
{
8+
get
9+
{
10+
// Set this style BEFORE base.CreateParams is created and returned.
11+
SetStyle(ControlStyles.ApplyThemingImplicitly, true);
12+
13+
CreateParams cp = base.CreateParams;
14+
15+
// Other logic
16+
return cp;
17+
}
18+
}
19+
20+
// Base class constructor is going to read CreateParams property
21+
// before your constructor code runs.
22+
public CustomControl1()
23+
{
24+
// At this point, CreateParams property is already read, you
25+
// can't set ApplyThemingImplicitly here.
26+
InitializeComponent();
27+
}
28+
}
29+
// </CreateParams>
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<root>
3+
<!--
4+
Microsoft ResX Schema
5+
6+
Version 2.0
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
11+
associated with the data types.
12+
13+
Example:
14+
15+
... ado.net/XML headers & schema ...
16+
<resheader name="resmimetype">text/microsoft-resx</resheader>
17+
<resheader name="version">2.0</resheader>
18+
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19+
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20+
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21+
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22+
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23+
<value>[base64 mime encoded serialized .NET Framework object]</value>
24+
</data>
25+
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26+
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27+
<comment>This is a comment</comment>
28+
</data>
29+
30+
There are any number of "resheader" rows that contain simple
31+
name/value pairs.
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
37+
mimetype set.
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
41+
extensible. For a given mimetype the value must be set accordingly:
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
45+
read any of the formats listed below.
46+
47+
mimetype: application/x-microsoft.net.object.binary.base64
48+
value : The object must be serialized with
49+
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50+
: and then encoded with base64 encoding.
51+
52+
mimetype: application/x-microsoft.net.object.soap.base64
53+
value : The object must be serialized with
54+
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55+
: and then encoded with base64 encoding.
56+
57+
mimetype: application/x-microsoft.net.object.bytearray.base64
58+
value : The object must be serialized into a byte array
59+
: using a System.ComponentModel.TypeConverter
60+
: and then encoded with base64 encoding.
61+
-->
62+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63+
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64+
<xsd:element name="root" msdata:IsDataSet="true">
65+
<xsd:complexType>
66+
<xsd:choice maxOccurs="unbounded">
67+
<xsd:element name="metadata">
68+
<xsd:complexType>
69+
<xsd:sequence>
70+
<xsd:element name="value" type="xsd:string" minOccurs="0" />
71+
</xsd:sequence>
72+
<xsd:attribute name="name" use="required" type="xsd:string" />
73+
<xsd:attribute name="type" type="xsd:string" />
74+
<xsd:attribute name="mimetype" type="xsd:string" />
75+
<xsd:attribute ref="xml:space" />
76+
</xsd:complexType>
77+
</xsd:element>
78+
<xsd:element name="assembly">
79+
<xsd:complexType>
80+
<xsd:attribute name="alias" type="xsd:string" />
81+
<xsd:attribute name="name" type="xsd:string" />
82+
</xsd:complexType>
83+
</xsd:element>
84+
<xsd:element name="data">
85+
<xsd:complexType>
86+
<xsd:sequence>
87+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88+
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89+
</xsd:sequence>
90+
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91+
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92+
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93+
<xsd:attribute ref="xml:space" />
94+
</xsd:complexType>
95+
</xsd:element>
96+
<xsd:element name="resheader">
97+
<xsd:complexType>
98+
<xsd:sequence>
99+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100+
</xsd:sequence>
101+
<xsd:attribute name="name" type="xsd:string" use="required" />
102+
</xsd:complexType>
103+
</xsd:element>
104+
</xsd:choice>
105+
</xsd:complexType>
106+
</xsd:element>
107+
</xsd:schema>
108+
<resheader name="resmimetype">
109+
<value>text/microsoft-resx</value>
110+
</resheader>
111+
<resheader name="version">
112+
<value>2.0</value>
113+
</resheader>
114+
<resheader name="reader">
115+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116+
</resheader>
117+
<resheader name="writer">
118+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119+
</resheader>
120+
</root>

0 commit comments

Comments
 (0)