* UITextBox: 修复了Enabled为false时,PasswordChar失效的问题
This commit is contained in:
parent
d4eefa4c09
commit
48e2274861
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user