2

Is it possible for Windows Forms to adopt the system theme (light or dark) in Windows 10? When I set Windows to a dark theme the WinForms app I am debugging still has a white title bar and background.

I read about how the SystemColors class is supposed to follow the system theme but the colors just remain the same when I use them with different themes. Any answers I could find were pre-Windows 10 so I'm hoping there is still a way or something I've missed to have the title bar of the form become dark and the SystemColors to change.

Desert Scuba
  • 107
  • 9

1 Answers1

0

I believe you have to check system theme at start and then set colors for all controls via code. There is no built-in option to change colors automatically depend on system theme.

Ether
  • 28
  • 7
  • I've found out that the system theme only applies to UWP apps and there's also a specific option in Windows personalisation settings for a user to apply an accent colour to title bars and window borders. So I might not try to change that part then, just the client areas by detecting the theme. https://stackoverflow.com/questions/56312190/how-do-i-make-my-form-title-bar-follow-the-windows-dark-theme – Desert Scuba Sep 12 '20 at 16:12
  • 1
    If you are new in C# desktop apps, I recommend you WPF more than WinForms. In WPF you can much easily create themes as many as you want and switch between them. – Ether Sep 12 '20 at 18:40