I was testing the new experimental dark mode for Windows Forms and decided to share it.
It is available from .Net 9 in Windows 11.
In the sample form I just added lots of different controls, there is no functionality to it, just looking at appearance.
I found that buttons with FlatStyle.Standard (the default) does not look good, but changing to FlatStyle.System works - see the two first buttons in screenshot as example.
TabPage backgrounds doesn't change, but can be set manually.
It is available from .Net 9 in Windows 11.
The attached project includes AppColorMode class that provides a dialog to choose mode at runtime, and a proxy for user setting, mode is applied from application event ApplyApplicationDefaults at startup. It is easy to add this to other projects to add optional support for dark mode. The TaskDialogPage itself was not made dark, even though I have dark mode enabled in OS.Preliminary support for dark mode has been added to Windows Forms, with the goal of finalizing support in .NET 10.
In the sample form I just added lots of different controls, there is no functionality to it, just looking at appearance.
I found that buttons with FlatStyle.Standard (the default) does not look good, but changing to FlatStyle.System works - see the two first buttons in screenshot as example.
TabPage backgrounds doesn't change, but can be set manually.
![learn.microsoft.com](https://learn.microsoft.com/en-us/media/open-graph-image.png)
Application.SetColorMode(SystemColorMode) Method (System.Windows.Forms)
Sets the default color mode (dark mode) for the application.
learn.microsoft.com
![learn.microsoft.com](https://learn.microsoft.com/en-us/media/open-graph-image.png)
SystemColorMode Enum (System.Windows.Forms)
Learn more about the System.Windows.Forms.SystemColorMode in the System.Windows.Forms namespace.
learn.microsoft.com