From 27086aa1dc5788a4a75f32fad91d973a8a7d5de8 Mon Sep 17 00:00:00 2001 From: czz_y Date: Tue, 20 Aug 2024 10:46:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=88=B6=E7=AA=97=E4=BD=93?= =?UTF-8?q?=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controls/SystemSet.cs | 15 +++++++++------ MainWindow.cs | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) 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) {