Edit

Share via


What's new in Windows Forms for .NET 10 Release Candidate

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.

.NET 10 RC 2 was released in October 2025.

Release announcements

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

Clipboard changes

Windows Forms is shipping new code for the clipboard API. The clipboard is redesigned in a way that its code can be shared with Windows Presentation Foundation (WPF). Both desktop technologies now share the same code and unify how they interact with the clipboard.

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

Async forms

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.

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 to use the feature. This compiler error is no longer triggered with .NET 10.

The following APIs are no longer considered experimental:

Custom designer improvements

Several UITypeEditor types have been ported from .NET Framework, including ToolStripCollectionEditor and several editors related to the DataGridView control. These editors are now discoverable by the PropertyGrid and the Windows Forms Designer Actions panel.

SnapLines were fixed for custom designers.

Dark mode

Windows Forms has fully integrated dark mode support.

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 to use the feature. This feature is no longer guarded behind this compiler error starting with .NET 10.

The Application.SetColorMode(SystemColorMode) API is no longer considered experimental.

Clarification on ControlStyles ApplyThemingImplicitly usage

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.

Regardless of your use case, override the Control.CreateParams property, and call SetStyle(ControlStyles.ApplyThemingImplicitly, true) (opt-in) or SetStyle(ControlStyles.ApplyThemingImplicitly, false) (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:

public partial class CustomControl1 : Control
{
    protected override CreateParams CreateParams
    {
        get
        {
            // Set this style BEFORE base.CreateParams is created and returned.
            SetStyle(ControlStyles.ApplyThemingImplicitly, true);

            CreateParams cp = base.CreateParams;
            
            // Other logic
            return cp;
        }
    }

    // Base class constructor is going to read CreateParams property
    // before your constructor code runs.
    public CustomControl1()  
    {
        // At this point, CreateParams property is already read, you
        // can't set ApplyThemingImplicitly here.
        InitializeComponent();
    }
}
Public Class CustomControl1

    Protected Overrides ReadOnly Property CreateParams As CreateParams
        Get
            ' Set this style BEFORE base.CreateParams is created and returned.
            SetStyle(ControlStyles.ApplyThemingImplicitly, True)

            Dim cp As CreateParams = MyBase.CreateParams

            ' Other logic
            Return cp
        End Get
    End Property

    ' Base class constructor is going to read CreateParams property
    ' before your constructor code runs.
    Sub New()

        ' At this point, CreateParams property is already read, you
        ' can't set ApplyThemingImplicitly here.

        InitializeComponent()

    End Sub

End Class

Bug fixes

Here are some of the bugs fixed in Windows Forms for .NET 10:

  • If the DataGridView was in edit mode while the hosting dialog was closed, it would throw InvalidOperationException. The bug causing this has been fixed.
  • Compiler Error WFO1000 has been improved to reduce false positives related to interfaces that derive from IComponent.
  • Fixed a regression with PrinterSettings.DefaultPageSettings.Color returning an incorrect value.
  • Resolving a memory leak in the MSHTML component.

Accessibility

Improved NVDA screen reader support.

Code cleanup

Removed deprecated .NET runtime and unnecessary package references. Code style has been cleaned up to address warnings and improve code quality.

ScreenCaptureMode API

A new API has been introduced to prevent screen capture applications (that use the Windows API) from capturing a form. This feature is useful to protect sensitive information, such as user names, user IDs, or passwords, from being leaked.

The Form.ScreenCaptureMode is set to one of the following values to control capture behavior:

  • Allow—(Default) Allows the form to be captured.
  • HideContent—The form appears blacked out when captured.
  • HideWindow—Blurs the form when captured. (Requires Windows 10 20H1 version 2004 or higher.)

Analyzer improvements

Existing analyzers have been fine-tuned to reduce false positives.

New analyzers have been added: