diff --git a/.github/agents/preview-release-updater.agent.md b/.github/agents/preview-release-updater.agent.md index 93bb2a2a67..9a2547593f 100644 --- a/.github/agents/preview-release-updater.agent.md +++ b/.github/agents/preview-release-updater.agent.md @@ -2,7 +2,7 @@ name: PreviewReleaseUpdater description: "Use when updating the monthly .NET Preview release notes for Windows Forms or WPF. Triggers: monthly preview update, .NET 11 preview, what's new preview, net110.md, preview release notes, bump preview number, new preview release." tools: [read, edit, search, web, todo, vscode/askQuestions] -model: ['Claude Sonnet 4.5 (copilot)'] +model: ['Claude Haiku 4.5 (copilot)'] version: 1 --- @@ -100,9 +100,10 @@ In the same product's `whats-new/index.md`: - `description`: if it mentions the preview/RC, keep it generic (".NET 11 {Preview|RC}" without a specific number). - `ms.date`: today's date. 2. **`## .NET 11 {Preview|RC}` section** (keep the heading generic without a specific preview/RC number): - - Note that this section contains information about every release. + - This section contains information about every release. - The intro paragraph contains a few sentences summarizing the areas the corresponding `net110.md` article covers. Update this if new sections have been added to `net110.md` that aren't reflected in the intro. If the intro is very out of date, rewrite it to reflect the new content. - - If the latest preview/RC doesn't contain any user-facing changes, put a `> [!NOTE]` below the intro paragraph with that info, like ".NET 11 {Preview|RC} doesn't contain any user-facing changes." (no specific preview/RC number) + - The intro paragraph shouldn't be updated to only list what's new in the current preview. It should summarize all cumulative content in `net110.md` to date. + - The intro paragraph should be short and high-level. - Replace the link list so it contains: - `- [Overview of {Windows Forms|WPF} on .NET 11 {Preview|RC}](net110.md)` (no specific preview/RC number) - One bullet per `##` section in the updated `net110.md`, formatted as `- [{Section title}](net110.md#{section-anchor})`. diff --git a/dotnet-desktop-guide/winforms/whats-new/index.md b/dotnet-desktop-guide/winforms/whats-new/index.md index 4d103f1bce..472313d66f 100644 --- a/dotnet-desktop-guide/winforms/whats-new/index.md +++ b/dotnet-desktop-guide/winforms/whats-new/index.md @@ -1,7 +1,7 @@ --- title: What's new in Windows Forms -description: Learn about what's new in Windows Forms. This article covers changes to Windows Forms from .NET 5 to .NET 11 Preview 6. -ms.date: 07/14/2026 +description: Learn about what's new in Windows Forms. This article covers changes to Windows Forms from .NET 5 to .NET 11 Preview 7. +ms.date: 08/11/2026 ms.service: dotnet-desktop ms.update-cycle: 365-days ms.topic: whats-new @@ -14,15 +14,21 @@ Each .NET release introduces a new version of Windows Forms (WinForms). This art ## .NET 11 Preview -This preview includes a regression fix for ToolStripDropDown focus handling in SmartTag and dropdown scenarios, along with previous improvements for clipboard, ToolStrip, layout, designer, PropertyGrid, and dark mode. +WinForms in .NET 11 Preview includes visual styles updates, system settings integration, performance improvements for bulk operations, and numerous bug fixes. - [Overview of Windows Forms on .NET 11 Preview](net110.md) +- [Visual styles and appearance](net110.md#visual-styles-and-appearance) +- [React to system visual settings](net110.md#react-to-system-visual-settings) +- [Deferred form reveal](net110.md#deferred-form-reveal) +- [Suspend painting during bulk mutations](net110.md#suspend-painting-during-bulk-mutations) +- [Toggle-switch appearance for CheckBox and RadioButton](net110.md#toggle-switch-appearance-for-checkbox-and-radiobutton) - [Clipboard](net110.md#clipboard) - [ToolStrip](net110.md#toolstrip) - [Layout](net110.md#layout) - [Designer](net110.md#designer) - [PropertyGrid](net110.md#propertygrid) - [Dark mode](net110.md#dark-mode) +- [Bug fixes](net110.md#bug-fixes) ## .NET 10 diff --git a/dotnet-desktop-guide/winforms/whats-new/net110.md b/dotnet-desktop-guide/winforms/whats-new/net110.md index 6170ac1676..fc62a7e576 100644 --- a/dotnet-desktop-guide/winforms/whats-new/net110.md +++ b/dotnet-desktop-guide/winforms/whats-new/net110.md @@ -2,7 +2,7 @@ title: What's new in WinForms for .NET 11 Preview description: Learn about what's new in Windows Forms for .NET 11 Preview. New versions of Windows Forms are released yearly with .NET. ms.topic: whats-new -ms.date: 07/14/2026 +ms.date: 08/11/2026 ms.service: dotnet-desktop ms.update-cycle: 365-days ai-usage: ai-assisted @@ -13,12 +13,13 @@ ai-usage: ai-assisted This article provides a high-level overview of what's new with Windows Forms (WinForms) in .NET 11 Preview. For detailed information, see [Release announcements](#release-announcements). Use the release announcements to get an overview of the entire .NET 11 release. The rest of this article highlights the most important changes to Windows Forms. -.NET 11 Preview 6 was released in July 2026. +.NET 11 Preview 7 was released in August 2026. ## Release announcements Each release announcement provides detailed information about Windows Forms changes for .NET 11: +- [.NET 11 Preview 7](https://aka.ms/dotnet/11/preview7) - [.NET 11 Preview 6](https://aka.ms/dotnet/11/preview6) - [.NET 11 Preview 5](https://aka.ms/dotnet/11/preview5) - [.NET 11 Preview 4](https://aka.ms/dotnet/11/preview4) @@ -26,6 +27,109 @@ Each release announcement provides detailed information about Windows Forms chan - [.NET 11 Preview 2](https://aka.ms/dotnet/11/preview2) - [.NET 11 Preview 1](https://aka.ms/dotnet/11/preview1) +## Visual styles and appearance + +`System.Windows.Forms.Application.SetDefaultVisualStylesMode` and the new `System.Windows.Forms.Control.VisualStylesMode` property provide an application and control-level opt-in for a refreshed rendering pipeline. Choose between the classic renderer (`VisualStylesMode.Classic`), visual styles turned off entirely (`VisualStylesMode.Disabled`), and the modern renderer (`VisualStylesMode.Net11`). `VisualStylesMode.Latest` always resolves to the newest mode the runtime supports. Child controls default to `VisualStylesMode.Inherit`, so the setting cascades from parent to child. + +The `Net11` mode brings modernized rendering for `Button`, `CheckBox`, `RadioButton`, `GroupBox`, `TextBox`, and `RichTextBox`. The `FlatStyle` property on buttons and checkboxes, and the `BorderStyle` property on text boxes, define the render style used. The `Padding` property on text boxes and rich text boxes is now accessible in the Property Grid and is applied when `VisualStylesMode` is `Net11` or newer. + +`Control.VisualStylesMode` is an ambient property, similar to `BackColor` or `Font`. Resolution walks up the parent chain, and when it reaches the top level, it falls through to `Application.DefaultVisualStylesMode`. Call `Control.GetVisualStylesModeChangeImpact` to report what needs updating when modes change, and `EffectiveVisualStylesMode` to retrieve the resolved value after inheritance. + +```csharp +using System.Windows.Forms; + +Application.SetDefaultVisualStylesMode(VisualStylesMode.Net11); + +Form form = new() +{ + Text = "Modern visual styles", + VisualStylesMode = VisualStylesMode.Latest, +}; + +ComboBox combo = new() { Dock = DockStyle.Top }; +combo.Items.AddRange(["One", "Two", "Three"]); +form.Controls.Add(combo); + +Application.Run(form); +``` + +## React to system visual settings + +`System.Windows.Forms.Application.SystemVisualSettings` exposes accent color, high-contrast state, keyboard-cue visibility, client-area animation settings, focus-border metrics, and text scale factor as a single snapshot. The new `System.Windows.Forms.Application.SystemVisualSettingsChanged` event fires whenever one of those categories changes. Update only the affected UI instead of rebuilding theme resources on every notification. `System.Windows.Forms.SystemVisualSettingsChangedEventArgs.Changed` is a `SystemVisualSettingsCategories` flags value that indicates which categories changed. Controls can override `OnSystemVisualSettingsChanged` to respond locally. + +```csharp +using System.Drawing; +using System.Windows.Forms; + +Application.SystemVisualSettingsChanged += (sender, e) => +{ + if ((e.Changed & SystemVisualSettingsCategories.AccentColor) != 0) + { + Color accent = e.NewSettings.AccentColor; + Console.WriteLine($"Accent color changed to {accent}."); + } + + if ((e.Changed & SystemVisualSettingsCategories.TextScale) != 0) + { + Console.WriteLine($"Text scale is now {e.NewSettings.TextScaleFactor:P0}."); + } +}; +``` + +## Deferred form reveal + +`System.Windows.Forms.FormRevealMode` gives applications control over when a form becomes visible during startup. `FormRevealMode.Deferred` keeps a form concealed until its initial layout and theming settle, avoiding the brief flash of an unstyled window when dark mode or the new visual styles apply after the form first shows. `FormRevealMode.Classic` preserves the existing show-immediately behavior, and `FormRevealMode.Inherit` follows the value set with `Application.SetDefaultFormRevealMode`. Call `Application.IsFormRevealDeferred` to report the resolved state, and handle the `Form.FormRevealModeChanged` event when the value changes. + +```csharp +using System.Windows.Forms; + +Application.SetDefaultVisualStylesMode(VisualStylesMode.Net11); +Application.SetDefaultFormRevealMode(FormRevealMode.Deferred); + +Form form = new() { Text = "No unstyled flash on startup" }; +Application.Run(form); +``` + +## Suspend painting during bulk mutations + +The new `System.Windows.Forms.ISupportSuspendPainting` interface and the `ControlMutationExtensions.SuspendPainting` extension method combine `BeginUpdate`/`EndUpdate` and `SuspendLayout`/`ResumeLayout` into a single `IDisposable` scope. `LayoutSuspendTraversal` controls whether the suspension applies to the target only or to the target and all of its descendants. This is particularly useful when applying changes to nested `TableLayoutPanel` containers with auto-sizing, where suspension prevents layout storms and flicker. + +, , , , and now implement `ISupportSuspendPainting`. They route their established suspension patterns (`BeginUpdate`/`EndUpdate`) through the new interface, so bulk edits avoid flicker without managing multiple paired calls. For all other controls, the suspension behavior is new. + +```csharp +using System.Windows.Forms; + +ListBox list = new(); + +using (list.SuspendPainting(LayoutSuspendTraversal.Target)) +{ + for (int i = 0; i < 10_000; i++) + { + list.Items.Add($"Item {i}"); + } +} +``` + +## Toggle-switch appearance for CheckBox and RadioButton + +`System.Windows.Forms.Appearance.ToggleSwitch` is a new value for `System.Windows.Forms.CheckBox.Appearance` that renders the control as a switch under `VisualStylesMode.Net11`. Existing `Checked`, `CheckedChanged`, and data-binding behavior stays unchanged, so you don't need code updates when switching a `CheckBox` to the new appearance. Modernize checkbox controls to align with contemporary UI conventions without breaking changes. + +```csharp +using System.Windows.Forms; + +CheckBox toggle = new() +{ + Text = "Enable notifications", + Appearance = Appearance.ToggleSwitch, + Checked = true, +}; +``` + +> [!IMPORTANT] +> Rendering behavior for Visual Styles and the associated new APIs is not yet final and will continue to change until .NET 11 reaches GA. Based on exploratory testing and customer feedback, controls using non-classic Visual Style settings may occupy more or less space in upcoming .NET 11 releases (RC, GA) than they do in Preview 7. The behavior of the new APIs may likewise change in detail or in specific scenarios. +> +> For this reason we recommend avoiding pixel-perfect design when adopting these features. Prefer layout-based approaches using `TableLayoutPanel` and `FlowLayoutPanel`, which adapt automatically to changes in control metrics. + ## Clipboard - with now correctly reads RTF clipboard data that doesn't include a null terminator. This fix resolves an issue where valid RTF content copied from applications such as PowerPoint returned an empty string. @@ -67,3 +171,21 @@ Each release announcement provides detailed information about Windows Forms chan ## Dark mode - now has default foreground and background colors for dark mode rendering, improving visual consistency in Fluent-themed applications. + +## Bug fixes + +- : The sequential immediate modifier parsing (such as `^a^c`, `+a+c`, `%f%t`) regression is fixed. The `KeyboardToolTipStateMachine` no longer throws `KeyNotFoundException` when focus changes during a tooltip popup event. + +- : `IsSynchronized` values are now correct across `ListBox` collections. + +- : Button rendering regression when visual styles are disabled is fixed. + +- : Transient GDI+ `ExternalException` during display-session transition when calling `RepaintSplitterRect` is now handled. + +- : The scroll-down button no longer throws when scrolling. Indeterminate and checked `ToolStripMenuItem` icons are now visible in dark mode. + +- : Property Page button icon no longer changes when `LargeButtons` is toggled on high DPI. `ResetHelpForeColor` now correctly resets the foreground color instead of the background color. + +- : `ForeColor` rendering is now correct when set to White. + +- **Dark mode**: `LinkLabel` contrast in Dark Mode is improved. `TabControl` nested in `SplitContainer` now matches dark mode. `HelpProvider` text is now visible in dark mode. `ToolTip` now switches to dark mode when `SystemColorMode.Dark` is set. diff --git a/dotnet-desktop-guide/wpf/whats-new/index.md b/dotnet-desktop-guide/wpf/whats-new/index.md index ecc6a48228..0fa1b8e344 100644 --- a/dotnet-desktop-guide/wpf/whats-new/index.md +++ b/dotnet-desktop-guide/wpf/whats-new/index.md @@ -1,7 +1,7 @@ --- title: What's new in Windows Presentation Foundation -description: Learn about what's new in Windows Presentation Foundation (WPF). This article covers changes to WPF from .NET 7 to .NET 11 Preview 6. -ms.date: 07/14/2026 +description: Learn about what's new in Windows Presentation Foundation (WPF). This article covers changes to WPF from .NET 7 to .NET 11 Preview 7. +ms.date: 08/11/2026 ms.service: dotnet-desktop ms.update-cycle: 365-days ms.topic: whats-new diff --git a/dotnet-desktop-guide/wpf/whats-new/net110.md b/dotnet-desktop-guide/wpf/whats-new/net110.md index 7c0d235b08..967cf593b3 100644 --- a/dotnet-desktop-guide/wpf/whats-new/net110.md +++ b/dotnet-desktop-guide/wpf/whats-new/net110.md @@ -2,7 +2,7 @@ title: What's new in WPF for .NET 11 Preview description: Learn about what's new in Windows Presentation Foundation (WPF) for .NET 11 Preview. New versions of WPF are released yearly with .NET. ms.topic: whats-new -ms.date: 07/14/2026 +ms.date: 08/11/2026 ms.service: dotnet-desktop ms.update-cycle: 365-days ai-usage: ai-assisted @@ -13,12 +13,13 @@ ai-usage: ai-assisted This article provides a high-level overview of what's new with Windows Presentation Foundation (WPF) in .NET 11 Preview. For detailed information, see [Release announcements](#release-announcements). Use the release announcements to get an overview of the entire .NET 11 release. -.NET 11 Preview 6 was released in July 2026. +.NET 11 Preview 7 was released in August 2026. ## Release announcements Each release announcement provides detailed information about WPF changes for .NET 11: +- [.NET 11 Preview 7](https://aka.ms/dotnet/11/preview7) - [.NET 11 Preview 6](https://aka.ms/dotnet/11/preview6) - [.NET 11 Preview 5](https://aka.ms/dotnet/11/preview5) - [.NET 11 Preview 4](https://aka.ms/dotnet/11/preview4)