Skip to content

Add .NET 10 P4 info #2085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2025
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
21 changes: 19 additions & 2 deletions dotnet-desktop-guide/winforms/whats-new/net100.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ title: What's new in WinForms for .NET 10 Preview
description: Learn about what's new in Windows Forms for .NET 10 Preview. New versions of Windows Forms are released yearly with .NET.
ms.topic: whats-new
ms.service: dotnet-desktop
ms.date: 04/09/2025
ms.date: 05/12/2025
#customer intent: As a developer, I want to know what's changed so that I can remain up-to-date.
---

# What's new in Windows Forms for .NET 10 Preview

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

.NET 10 Preview 3 was released in April 2025.
.NET 10 Preview 4 was released in May 2025.

## Release announcements

- [.NET 10 Preview 4](https://aka.ms/dotnet/10/preview4)
- [.NET 10 Preview 3](https://aka.ms/dotnet/10/preview3)
- [.NET 10 Preview 2](https://aka.ms/dotnet/10/preview2)
- [.NET 10 Preview 1](https://aka.ms/dotnet/10/preview1)
Expand All @@ -29,6 +30,22 @@ Windows Forms is shipping new code for the clipboard API. The clipboard is redes

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.

SnapLines were fixed for custom designers.

## Bug fixes

If the <xref:System.Windows.Forms.DataGridView> was in edit mode while the hosting dialog was closed, it would throw `InvalidOperationException`. The bug causing this has been fixed.

## Accessability

Improved NVDA screen reader support.

## Analyzer improvements

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

New analyzers have been added:

- [Warning WFDEV004 - `Form.OnClosing`, `Form.OnClosed` and the corresponding events are obsolete.](../wfdev-diagnostics/wfdev004.md)
- [Warning WFDEV005 - `GetData` methods are obsolete. Use `TryGetData<T>` methods instead.](../wfdev-diagnostics/wfdev005.md)
- [Warning WFDEV006 - Some controls are obsolete. They're provided for binary compatibility with .NET Framework.](../wfdev-diagnostics/wfdev006.md)
65 changes: 61 additions & 4 deletions dotnet-desktop-guide/wpf/whats-new/net100.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: What's new in WPF for .NET 10 Preview
description: Learn about what's new in Windows Presentation Foundation (WPF) for .NET 10 Preview. New versions of WPF are released yearly with .NET.
ms.topic: whats-new
ms.date: 04/09/2025
ms.date: 05/12/2025
ms.service: dotnet-desktop
#customer intent: As a developer, I want to know what's changed so that I can remain up-to-date.
---
Expand All @@ -11,10 +11,11 @@ ms.service: dotnet-desktop

This article provides a high-level overview about what's new with Windows Presentation Foundation (WPF) in .NET 10 Preview. For detailed information, see the [release announcements](#release-announcements).

.NET 10 Preview 3 was released in April 2025.
.NET 10 Preview 4 was released in May 2025.

## Release announcements

- [.NET 10 Preview 4](https://aka.ms/dotnet/10/preview4)
- [.NET 10 Preview 3](https://aka.ms/dotnet/10/preview3)
- [.NET 10 Preview 2](https://aka.ms/dotnet/10/preview2)
- [.NET 10 Preview 1](https://aka.ms/dotnet/10/preview1)
Expand All @@ -25,14 +26,36 @@ Performance was improved by replacing internal data structures with base .NET ty

Enhanced performance by optimizing cache operations, array handling, and migrating font collection loader to managed code.

Performance was optimized across font rendering, dynamic resources, input composition, trace logging, regex usage, and XAML parsing.

## Fluent style changes

Various bug fixes have been addressed in .NET 10, to improve the Fluent UI style support in WPF. Fluent UI style support is still in progress.

- Fluent styles added more controls, such as <xref:System.Windows.Controls.Label>, <xref:System.Windows.Documents.Hyperlink>, <xref:System.Windows.Navigation.NavigationWindow>, <xref:System.Windows.Controls.GroupBox>, and <xref:System.Windows.Controls.GridSplitter>.
- Fluent styles added more controls, such as:

- <xref:System.Windows.Controls.Label>
- <xref:System.Windows.Documents.Hyperlink>
- <xref:System.Windows.Navigation.NavigationWindow>
- <xref:System.Windows.Controls.GroupBox>
- <xref:System.Windows.Controls.GridSplitter>
- <xref:System.Windows.Controls.TextBox>
- <xref:System.Windows.Controls.DatePicker>
- <xref:System.Windows.Controls.RichTextBox>

- Fixed the animation for <xref:System.Windows.Controls.Expander>.
- Fixed crashes related to `HighContrast`.
- Added missing <xref:System.Windows.Controls.ContentPresenter.RecognizesAccessKey> for controls.
- Right-to-left layout issues have been fixed for <xref:System.Windows.Controls.MenuItem>, <xref:System.Windows.Controls.Expander>, <xref:System.Windows.Controls.TreeViewItem>.

> [!WARNING]
> .NET 10 Preview 4 introduced a bug related to fluent styles. For more information, see [.NET 10 Preview 4 release notes](https://aka.ms/dotnet/10/preview4).

## Clipboard changes

WPF and Windows Forms now use the same clipboard API. Both desktop technologies 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`.

## Bug fixes

Expand All @@ -52,7 +75,41 @@ Moving out of .NET Framework left behind unused Code Access Security (CAS) relat
- Remove unused CAS and XBAP code from `OleCmdHelper/ISecureCommand`.
- Remove unused CAS code from `FontSourceCollection/FontSource`.

Conducted extensive code cleanups, including syntax standardization and argument clarity, to improve code readability and maintainability.
Conducted extensive code cleanups, including syntax standardization and argument clarity, to improve code readability and maintainability. Debugging patterns were modernized and legacy constructs like `ArrayList` were phased out for maintainability.

## New APIs

Community contributor **bstordrup** enhanced the `MessageBox` with more button and result options. For more information, see [#9613](https://github.com/dotnet/wpf/issues/9613).

```diff
namespace System.Windows
{
public enum MessageBoxButton
{
OK = 0,
OKCancel = 1,
+ AbortRetryIgnore = 2,
YesNoCancel = 3,
YesNo = 4,
+ RetryCancel = 5,
+ CancelTryContinue = 6,
}

public enum MessageBoxResult
{
None = 0,
OK = 1,
Cancel = 2,
+ Abort = 3,
+ Retry = 4,
+ Ignore = 5,
Yes = 6,
No = 7,
+ TryAgain = 10,
+ Continue = 11,
}
}
```

## Miscellaneous changes

Expand Down