Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

What's new in Windows Forms for .NET 10

Feedback

In this article

This article provides a high-level overview about what's new with Windows Forms (WinForms) in .NET 10. For detailed information, see therelease announcements. Use the release announcements to get an overview of the entire .NET 10 release. The rest of the sections sections highlight some of most the important changes to Windows Forms.

.NET 10 was released in November 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. For more information, seeWindows Forms clipboard and DataObject changes in .NET 10.

.NET 9 obsoletedBinaryFormatter, 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 fromBinaryFormatter, .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 forBinaryFormatter.

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

SeveralUITypeEditor types have been ported from .NET Framework, includingToolStripCollectionEditor and several editors related to theDataGridView control. These editors are now discoverable by thePropertyGrid 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 suppressCompiler Error WFO5001 to use the feature. This feature is no longer guarded behind this compiler error starting with .NET 10.

TheApplication.SetColorMode(SystemColorMode) API is no longer considered experimental.

Clarification on ControlStylesApplyThemingImplicitly 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 theCreateParams 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 theControl.CreateParams property, and callSetStyle(ControlStyles.ApplyThemingImplicitly, true) (opt-in) orSetStyle(ControlStyles.ApplyThemingImplicitly, false) (opt-out) before the parameters are read from the base class. Youcannot set this style in your constructor. The base constructor reads theCreateParams 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 SubEnd Class

Bug fixes

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

  • If theDataGridView was in edit mode while the hosting dialog was closed, it would throwInvalidOperationException. The bug causing this has been fixed.
  • Compiler Error WFO1000 has been improved to reduce false positives related to interfaces that derive fromIComponent.
  • Fixed a regression withPrinterSettings.DefaultPageSettings.Color returning an incorrect value.
  • Resolving a memory leak in theMSHTML 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.

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

Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, seeour contributor guide.

Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?