Kintai.Windows.Forms 2023.7.4.1-priview
窗体控件库主题风格使用说明
1. 引用 Kintai.Windows 命名空间;
2. 所有窗体(Form)继承改为:ThemeForm
3. 所有用户控件(UserControl)继承改为:ThemeUserControl
4. 所有消息框(MessageBox.Show)改为:this.ShowMsg
5. 设置主题
Theme.CurrentTheme = new Themes.Dark();//设置主题 深色
或者
Theme.CurrentTheme = new Themes.Light();//设置主题 浅色
##(以下设置位置任选其一)
5.1. 程序启动时
Program.cs 调用方法示例:
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Theme.CurrentTheme = new Themes.Dark();//设置主题 深色
Application.Run(new FrmTheme());
}
}
5.2. 窗体加载时
Form_Load 调用方法示例:
public partial class FrmTheme : ThemeForm
{
public FrmTheme()
{
InitializeComponent();
}
private void ThemeForm_Load(object sender, EventArgs e)
{
ThisTheme = new Themes.Dark();//设置主题 深色
// 示例带主题风格的消息框
var res = this.ShowMsg("当前是深色主题模式", "警告", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);
this.Text = res.ToString();
}
}
5.3. 按钮点击时
Button_Click 调用方法示例:
private void button1_Click(object sender, EventArgs e)
{
Theme.CurrentTheme = new Themes.Light();//设置主题 浅色
// 示例带主题风格的消息框
var res = this.ShowMsg("当前是浅色主题模式", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.Text = res.ToString();
}
Showing the top 20 packages that depend on Kintai.Windows.Forms.
.NET Framework 4.8
- No dependencies.
.NET 5.0
- No dependencies.
| Version | Downloads | Last updated |
|---|---|---|
| 2026.7.27.1 | 5 | 07/29/2026 |
| 2026.4.29.1 | 58 | 04/29/2026 |
| 2026.4.20.1 | 48 | 04/20/2026 |
| 2025.2.27.1 | 302 | 02/27/2025 |
| 2025.2.25.1 | 32 | 02/25/2025 |
| 2025.2.17.1 | 79 | 02/17/2025 |
| 2025.2.12.1 | 40 | 02/12/2025 |
| 2024.12.6.1 | 85 | 12/06/2024 |
| 2024.1.17.1 | 281 | 01/17/2024 |
| 2024.1.16.1 | 87 | 01/16/2024 |
| 2024.1.2.2 | 64 | 01/02/2024 |
| 2024.1.2.1 | 74 | 01/02/2024 |
| 2024.1.2.1-preview | 64 | 01/02/2024 |
| 2023.12.29.5-preview | 63 | 12/29/2023 |
| 2023.12.29.4-preview | 31 | 12/29/2023 |
| 2023.12.29.3-preview | 32 | 12/29/2023 |
| 2023.12.29.2-preview | 36 | 12/29/2023 |
| 2023.12.29.1-preview | 35 | 12/29/2023 |
| 2023.8.15.1-preview | 186 | 08/15/2023 |
| 2023.7.7.1-preview | 137 | 07/07/2023 |
| 2023.7.4.1-priview | 189 | 07/04/2023 |
| 2023.7.4.1-preview | 38 | 07/04/2023 |
| 2023.6.29.2 | 55 | 06/29/2023 |
| 2023.6.25.4 | 65 | 06/25/2023 |
| 2021.12.2.1 | 1,598 | 12/02/2021 |
| 2021.11.18.1-preview | 77 | 11/18/2021 |
| 2021.11.15.1-preview | 33 | 11/15/2021 |
| 2021.9.29.1 | 85 | 11/01/2021 |
| 2021.9.29.1-preview | 58 | 09/29/2021 |
| 2021.9.28.1-preview | 33 | 09/28/2021 |
| 2021.9.27.2-preview | 32 | 09/27/2021 |
| 2021.9.27.1-preview | 35 | 09/27/2021 |
| 2021.8.30.1-preview | 31 | 08/30/2021 |
| 2021.8.27.6-preview | 28 | 08/27/2021 |
| 2021.8.27.5-preview | 37 | 08/27/2021 |
| 2021.8.27.4-preview | 29 | 08/27/2021 |
| 2021.8.27.3-preview | 29 | 08/27/2021 |
| 2021.8.27.2-preview | 33 | 08/27/2021 |
| 2021.8.27.1-preview | 30 | 08/27/2021 |