* UITextBox: 修复了Enabled为false时,PasswordChar失效的问题

This commit is contained in:
Sunny 2023-07-16 20:41:30 +08:00
parent d4eefa4c09
commit 48e2274861
2 changed files with 11 additions and 4 deletions

View File

@ -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);
}
}
}

View File

@ -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;