From 352078c6a22c61b2412297330ab972ac2754d2d9 Mon Sep 17 00:00:00 2001 From: czz_y Date: Mon, 21 Oct 2024 17:28:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A71.6.12=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=BA=86safe=20handle=E9=94=99=E8=AF=AF=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Ddatepicker=E8=AE=BE=E7=BD=AE=E6=9C=80?= =?UTF-8?q?=E5=A4=A7/=E5=B0=8F=E8=8C=83=E5=9B=B4=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=8A=96=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AntdUIDemo.csproj | 4 ++-- Program.cs | 3 ++- README.md | 2 +- Utils/ThemeHelper.cs | 9 +++++++++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/AntdUIDemo.csproj b/AntdUIDemo.csproj index b3ae29f..153f326 100644 --- a/AntdUIDemo.csproj +++ b/AntdUIDemo.csproj @@ -13,7 +13,7 @@ Copyright © 2024 czz_y $(Version) $(Version) - 1.6.11 + 1.6.12 czz_y 基于 Winform UI 框架 AntdUI 设计的 Demo https://gitee.com/mubaiyanghua/antd-uidemo @@ -30,7 +30,7 @@ - + diff --git a/Program.cs b/Program.cs index bdfd949..f6d426e 100644 --- a/Program.cs +++ b/Program.cs @@ -16,7 +16,8 @@ namespace AntdUIDemo Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); - + AntdUI.Config.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; + AntdUI.Config.SetCorrectionTextRendering("Microsoft YaHei UI"); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); mainWindow = new MainWindow(); diff --git a/README.md b/README.md index 245c31b..f2d8ade 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

AntdUI Demo

-本项目基于 `Winform .NET Framework 4.8` 开发,是 [AntdUI](https://gitee.com/antdui/AntdUI) 的 Demo 项目,当前版本 `1.6.11` +本项目基于 `Winform .NET Framework 4.8` 开发,是 [AntdUI](https://gitee.com/antdui/AntdUI) 的 Demo 项目,当前版本 `1.6.12` diff --git a/Utils/ThemeHelper.cs b/Utils/ThemeHelper.cs index f9f6f52..c81c45c 100644 --- a/Utils/ThemeHelper.cs +++ b/Utils/ThemeHelper.cs @@ -5,6 +5,10 @@ namespace AntdUIDemo.Utils { public class ThemeHelper { + /// + /// 判断是否浅色 + /// + /// public static bool IsLightMode() { RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"); @@ -20,6 +24,11 @@ namespace AntdUIDemo.Utils return true; } + /// + /// 设置明暗颜色 + /// + /// + /// public static void SetColorMode(AntdUI.Window window, bool isLight) { if (!isLight)