diff --git a/Controls/SystemSet.cs b/Controls/SystemSet.cs index 9189b7e..6ee7ff1 100644 --- a/Controls/SystemSet.cs +++ b/Controls/SystemSet.cs @@ -1,4 +1,5 @@ -using System; +using AntdUI; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; @@ -13,8 +14,10 @@ namespace AntdUIDemo.Controls { public partial class SystemSet : UserControl { - public SystemSet() + private Window Window; + public SystemSet(Window _window) { + Window = _window; InitializeComponent(); //初始化下拉框 InitSelectItems(); @@ -50,14 +53,14 @@ namespace AntdUIDemo.Controls if (value) { AntdUI.Config.IsLight = true; - BackColor = Color.White; - ForeColor = Color.Black; + Window.BackColor = Color.White; + Window.ForeColor = Color.Black; } else { AntdUI.Config.IsDark = true;// 设置为深色模式 - BackColor = Color.Black; - ForeColor = Color.White; + Window.BackColor = Color.Black; + Window.ForeColor = Color.White; } } diff --git a/MainWindow.cs b/MainWindow.cs index f9ab198..3ed6a0a 100644 --- a/MainWindow.cs +++ b/MainWindow.cs @@ -24,7 +24,7 @@ namespace AntdUIDemo private void ButtonSZ_Click(object sender, EventArgs e) { - using (var form = new SystemSet()) + using (var form = new SystemSet(this)) { AntdUI.Modal.open(new AntdUI.Modal.Config(this, "系统设置", form, TType.Info) {