2.0 KiB
WinForms .NET 10 RC1 Release Notes
Here's a summary of what's new in WinForms in this release:
- Dark Mode Now Fully Integrated
- Clarification on ControlStyles
ApplyThemingImplicitlyUsage - Several more improvements to renderer, async, and state management
Windows Forms updates in .NET 10:
- What's new in Windows Forms documentation
Dark Mode Now Fully Integrated
Dark mode is officially out of experimental status and can be used without special configuration. Keep in mind that the dark mode renderer relies on underlying Win32 controls, and while we anticipate improvements, dark mode support will evolve over time. Refer to our updated docs for the latest scope and details.
Clarification on ControlStyles ApplyThemingImplicitlyUsage
While the ControlStyles enum element ApplyThemingImplicitly isn’t new, it now has a more precise application for opting in or out of dark mode theming: It’s crucial to set this enum flag in a derived control in CreateParams before calling the base method. Due to the original WinForms design, CreateParams runs before derived class constructors, and this order can be a common pitfall if not highlighted. We've updated the docs with this note, and it’s important for developers inheriting controls to follow this guidance, if they want their control to opt in or out implicit theming handling.
Other Improvements
-
Renderer and Color Fixes: We've resolved issues with foreground and background colors for buttons and text boxes in dark mode.
-
Async Enhancements:
InvokeAsync,ShowAsync, andShowDialogAsyncare now stable and out of experimental mode, with optimized allocations and documented behavior for canceled tasks. -
Improved Form.Show Async State Management: The async task state now carries a weak reference to the form, enabling responsive UIs when managing multiple windows.