Exploring WinForms Dark Mode in .NET 10: Insights from Tim Corey
WinForms has long been a reliable framework for building Windows desktop applications. With the release of .NET 10, Microsoft has introduced official dark mode support for WinForms, bringing a modern look to legacy Windows Forms projects.
In his video on "Dark Mode in WinForms in .NET 10 - But It's Not Perfect", Tim Corey provides a practical walkthrough, showing developers how to enable dark mode while also pointing out the current limitations and considerations. Following his demonstration gives a clear understanding of what’s possible and what’s still in preliminary support stages.
Introduction to Dark Mode in WinForms
Tim begins by noting that while dark mode is now officially implemented in WinForms, it is not without limitations. He introduces his 10-minute training series as a concise approach for developers who want quick answers instead of long theoretical explanations.
Using Visual Studio 2026, Tim opens a simple Windows Forms project file targeting .NET 10. The app is a basic form that displays a "Hello World" message with a text box and button. To ensure consistency across machines, he sets the DPI to 200% and marks the designer as DPI-unaware, which is important for avoiding errors when the application runs on different Windows systems. This initial setup allows him to focus purely on the feature of dark mode in WinForms.
Enabling Dark Mode via Program.cs
Tim explains that the main entry point of a WinForms app is in the internal static class Program and the static void Main method. Here, developers can set the color mode before calling Application.Run. He demonstrates that the color mode changes can be done either before Application.Initialize() or right before starting the main application.
WinForms in .NET 10 provides three options for color mode:
Classic: Standard light mode.
Dark: Enables dark mode for the form and most controls.
- System mode: Detects the current Windows system theme and applies it to the app.
Tim emphasizes that setting this property must happen before controls are created in the constructor or Form1.Designer.cs. Failing to do so results in some controls remaining in light mode, even though dark mode is enabled at the runtime.
Limitation: Designer Does Not Reflect Dark Mode
Tim points out a critical limitation: the form designer does not show dark mode changes. Even after setting the color mode in the Program.cs file, the designer displays all controls in light mode.
Examining Form1.Designer.cs, Tim highlights that the controls, such as buttons, text boxes, and labels, are initialized in the constructor. The color mode line must be set before any instance of controls is created. Despite this, the WinForms designer does not update visually, which is an important consideration when finalizing UI layouts.
Running the application, however, confirms that the dark mode is correctly applied at runtime, with text turning white, buttons responding to hover, and input fields displaying white text on dark backgrounds.
Limitation: Some Controls Do Not Support Dark Mode
A limitation Tim emphasizes is that not all Windows Forms controls respond to dark mode. For example, MessageBox dialogs always display in light mode, ignoring system mode or the dark mode setting.
This is because WinForms is built on Win32 libraries, which were not originally designed with dark themes in mind. As Tim explains, Microsoft is gradually converting libraries to support dark mode, but this feature remains experimental in some aspects. Developers requiring consistent theme support across all controls may need to use a third-party library or create custom controls.
Limitation: Only Supported on Windows 11
Tim notes another important limitation: dark mode in WinForms only works on Windows 11. On older versions, including Windows 10, the color mode will default back to classic or light mode, regardless of what is set in the internal static class Program.
This restriction is crucial when developing applications for a broad user base. Developers need to detect the Windows system version or set a default fallback to light mode to avoid unexpected UI inconsistencies.
Limitation: System Mode Does Not Auto-Update
When using system mode, WinForms detects the system theme at application startup. Tim points out that if the user changes the Windows theme while the app is running, the application will not automatically adjust. A restart is required for the theme to update, which is an inherent limitation of Win32 backporting.
This behavior emphasizes the need for developers to decide whether to enforce a default theme or rely on system mode with the understanding that runtime changes require a restart.
Limitation: Accessibility and High Contrast Themes
Tim also warns that dark mode does not work with accessibility themes, including high contrast settings. If a user enables a Windows accessibility theme, the form and controls revert to light mode.
This is important for developers who want to support all user scenarios, particularly those who rely on contrast settings for readability.
Practical Advice for Developers
Despite these limitations, Tim highlights the ease of enabling dark mode in WinForms. It requires just one line of code in the Program.cs file, making it simple to test and implement.
He recommends using system mode by default, allowing the application to conform to the user’s theme instead of forcing a particular mode. Tim also encourages upgrading to .NET 10 to benefit from performance improvements and finalized support for dark mode, compared to experimental support in .NET 9.
Conclusion
Tim Corey concludes that while dark mode in WinForms .NET 10 is a feature officially implemented, there are several limitations developers should consider:
Designer does not display dark mode.
Some controls, like MessageBox, remain in light mode.
Only supported on Windows 11; older systems fall back to classic mode.
System mode changes require a restart.
- Accessibility themes are not compatible with dark mode.
Even with these caveats, the ability to enable dark mode with minimal effort is a welcome addition to Windows Forms projects. By following Tim Corey’s video, developers can confidently set color modes, test their forms, and decide how best to implement dark mode for their users.

