Windows Forms dark mode test

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,857
Location
Norway
Programming Experience
10+
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.
Preliminary support for dark mode has been added to Windows Forms, with the goal of finalizing support in .NET 10.
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.

1739032424518.png


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.

1739032801542.png


 

Attachments

  • WinFormsDark.zip
    12.7 KB · Views: 0
Back
Top