将深色模式应用于表单中的所有控件 [WinForms]
Apply Dark Mode to all Controls in a Form [WinForms]
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:
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:
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:
…private DarkModeCS dm = null;
public Form1()
{
InitializeComponent();
dm = new DarkModeCS(this)
{
//[Optional] Choose your preferred color mode here:
ColorMode = DarkModeCS.DisplayMode.SystemDefault
};
}There are a few Winforms Controls that are, by design, extremely hard to theme:
暂无开放 Issues,或尚未同步最近议题。