Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

Dark-Mode-Forms

> 编程语言
Open source

Apply Dark Mode to all Controls in a Form [WinForms]

186 stars0 likes2 views
WebsiteGitHub

About

Apply Dark Mode to all Controls in a Form [WinForms]

Dark-Mode-Forms

Apply Dark Mode to all Controls in a Form [WinForms]

  • This will detect if dark mode color is enabled in Windows settings.
  • Then iterate all the controls on your form and try to convert them to DarkMode (if enabled).
  • [Optional] If you have icons on your menus or toolbars, they will be recolored to give you a lighter, more visible-in-the-dark version of your icons. (Works best with monochrome icons)
  • You can access Windows Dark Colors and use them for whatever you need.

Now with Dark Messenger

Window's default MessageBox cant not be themed, so Added a Messenger.cs class that allowes the user to popup Messages and InputBoxes:

  • Messenger.MessageBox is a Direct replacement for the old MessageBox.Show, the new one applies Windows's Dark Mode automaticaly.

  • Messenger.InputBox is a replacement for VisualBasic's InputBox, implemented for C# and with extended functionalities:

    • In its simplies form, you ask the user for a Text Input, then you use that for whatever you need
    • But Messenger.InputBox allowes you to promt the user with many more 'Fields' of different types:
  • Button Texts are automatically translated to 7 Languages: en, es, de, fr, ru, kr, zh.

  • DarkMode doesnt require the Messenger but Messenger does require DarkMode.

MessageBox:

csharp
try
{
   if (Messenger.MessageBox("Hello World!", "You got a Message:",
       MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK)
   {
      //Do Something here.
   }
}
catch (Exception ex)
{
   Messenger.MessageBox(ex);
}

InputBox:

…

Example of a LoginForm with Password Validation:

…

Implementation

  • No Nuggets, No external DLLs, Just 1 File: DarkModeCS.cs Copy/Paste or Download and import it into your project.
csharp
private DarkModeCS dm = null;

public Form1()
{
	InitializeComponent();
	dm = new DarkModeCS(this)
	{
		//[Optional] Choose your preferred color mode here:
		ColorMode = DarkModeCS.DisplayMode.SystemDefault
	};
}

Dark Mode Colors

Framework Compatibility

  • .NET 4.8+
  • .NET 6.0+
  • .NET 8.0+
  • Some stuff may only work on Windows 11+
  • VS 2022+

Limitations

There are a few Winforms Controls that are, by design, extremely hard to theme:

  • TabControl: 90% themed, a white border around the selected tab still remains. You could use FlatTabControl instead, check in the Example.
  • MessageBox: Can't be themed. You can use Messenger instead.
  • DateTimePicker: Un-themed.
  • MonthCalendar: Un-themed.
  • ProgressBar: Un-themed. You can use FlatProgressBar instead.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言