diff --git a/SunnyUI/Controls/UIEdit.cs b/SunnyUI/Controls/UIEdit.cs index 06bfb3b3..35cc246c 100644 --- a/SunnyUI/Controls/UIEdit.cs +++ b/SunnyUI/Controls/UIEdit.cs @@ -171,17 +171,23 @@ namespace Sunny.UI if (Text.IsValid() && !Enabled) { + string text = Text; + if (PasswordChar > 0) + { + text = PasswordChar.ToString().Repeat(text.Length); + } + if (TextAlign == HorizontalAlignment.Left) { - e.Graphics.DrawString(Text, Font, ForeDisableColor, new Rectangle(0, 0, Width, Height), ContentAlignment.MiddleLeft, -5, 0); + e.Graphics.DrawString(text, Font, ForeDisableColor, new Rectangle(0, 0, Width, Height), ContentAlignment.MiddleLeft, -5, 0); } else if (TextAlign == HorizontalAlignment.Right) { - e.Graphics.DrawString(Text, Font, ForeDisableColor, new Rectangle(0, 0, Width, Height), ContentAlignment.MiddleRight, 7, 0); + e.Graphics.DrawString(text, Font, ForeDisableColor, new Rectangle(0, 0, Width, Height), ContentAlignment.MiddleRight, 7, 0); } else { - e.Graphics.DrawString(Text, Font, ForeDisableColor, new Rectangle(0, 0, Width, Height), ContentAlignment.MiddleCenter, 1, 0); + e.Graphics.DrawString(text, Font, ForeDisableColor, new Rectangle(0, 0, Width, Height), ContentAlignment.MiddleCenter, 1, 0); } } } diff --git a/SunnyUI/Controls/UITextBox.cs b/SunnyUI/Controls/UITextBox.cs index 8b86ee2b..572cc077 100644 --- a/SunnyUI/Controls/UITextBox.cs +++ b/SunnyUI/Controls/UITextBox.cs @@ -47,7 +47,8 @@ * 2023-02-07: V3.3.1 增加Tips小红点 * 2023-02-10: V3.3.2 有水印时,系统响应触摸屏增加了TouchPressClick属性,默认关闭 * 2023-06-14: V3.3.9 按钮图标位置修正 - * 2024-07-03: V3.3.9 增加Enabled为false时,可修改文字颜色 + * 2023-07-03: V3.3.9 增加Enabled为false时,可修改文字颜色 + * 2023-07-16: V3.4.0 修复了Enabled为false时,PasswordChar失效的问题 ******************************************************************************/ using System;