* UIIPTextBox: 修复Enabled切换时背景色不一致的问题
This commit is contained in:
parent
2a859f60e9
commit
ca15a2f1c5
@ -639,8 +639,8 @@ namespace Sunny.UI
|
||||
|
||||
e.Graphics.FillEllipse(bcColor, (Width - CircleSize) / 2.0f, Height - Padding.Bottom - CircleSize, CircleSize, CircleSize);
|
||||
e.Graphics.DrawFontImage(Symbol, SymbolSize, SymbolColor,
|
||||
new RectangleF(
|
||||
symbolOffset.X + (Width - CircleSize) / 2.0f,
|
||||
new Rectangle(
|
||||
symbolOffset.X + (int)(Width - CircleSize) / 2,
|
||||
symbolOffset.Y + Height - Padding.Bottom - CircleSize,
|
||||
CircleSize,
|
||||
CircleSize));
|
||||
@ -667,9 +667,9 @@ namespace Sunny.UI
|
||||
|
||||
e.Graphics.FillEllipse(bcColor, Padding.Left, (Height - CircleSize) / 2.0f, CircleSize, CircleSize);
|
||||
e.Graphics.DrawFontImage(Symbol, SymbolSize, SymbolColor,
|
||||
new RectangleF(
|
||||
new Rectangle(
|
||||
symbolOffset.X + Padding.Left,
|
||||
symbolOffset.Y + (Height - CircleSize) / 2.0f,
|
||||
symbolOffset.Y + (int)(Height - CircleSize) / 2,
|
||||
CircleSize,
|
||||
CircleSize));
|
||||
}
|
||||
@ -699,9 +699,9 @@ namespace Sunny.UI
|
||||
|
||||
e.Graphics.FillEllipse(bcColor, Width - Padding.Right - CircleSize, (Height - CircleSize) / 2.0f, CircleSize, CircleSize);
|
||||
e.Graphics.DrawFontImage(Symbol, SymbolSize, SymbolColor,
|
||||
new RectangleF(
|
||||
new Rectangle(
|
||||
symbolOffset.X + Width - Padding.Right - CircleSize,
|
||||
symbolOffset.Y + (Height - CircleSize) / 2.0f,
|
||||
symbolOffset.Y + (int)(Height - CircleSize) / 2,
|
||||
CircleSize,
|
||||
CircleSize));
|
||||
}
|
||||
@ -727,8 +727,8 @@ namespace Sunny.UI
|
||||
|
||||
e.Graphics.FillEllipse(bcColor, (Width - CircleSize) / 2.0f, Padding.Top, CircleSize, CircleSize);
|
||||
e.Graphics.DrawFontImage(Symbol, SymbolSize, SymbolColor,
|
||||
new RectangleF(
|
||||
symbolOffset.X + (Width - CircleSize) / 2.0f,
|
||||
new Rectangle(
|
||||
symbolOffset.X + (int)(Width - CircleSize) / 2,
|
||||
symbolOffset.Y + Padding.Top,
|
||||
CircleSize,
|
||||
CircleSize));
|
||||
|
@ -19,6 +19,7 @@
|
||||
* 2022-01-29: V3.1.0 增加文件说明
|
||||
* 2022-11-02: V3.2.6 增加TextChanged事件
|
||||
* 2022-12-02: V3.3.0 删除TextChanged事件,增加ValueChanged事件
|
||||
* 2022-05-10: V3.3.6 修复Enabled切换时背景色不一致的问题
|
||||
******************************************************************************/
|
||||
|
||||
using System;
|
||||
@ -264,6 +265,19 @@ namespace Sunny.UI
|
||||
txt4.ForeColor = UIFontColor.Primary;
|
||||
}
|
||||
|
||||
protected override void OnEnabledChanged(EventArgs e)
|
||||
{
|
||||
base.OnEnabledChanged(e);
|
||||
txt1.BackColor = Enabled ? fillColor : FillDisableColor;
|
||||
txt1.ForeColor = UIFontColor.Primary;
|
||||
txt2.BackColor = Enabled ? fillColor : FillDisableColor;
|
||||
txt2.ForeColor = UIFontColor.Primary;
|
||||
txt3.BackColor = Enabled ? fillColor : FillDisableColor;
|
||||
txt3.ForeColor = UIFontColor.Primary;
|
||||
txt4.BackColor = Enabled ? fillColor : FillDisableColor;
|
||||
txt4.ForeColor = UIFontColor.Primary;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
|
@ -518,8 +518,7 @@ namespace Sunny.UI
|
||||
{
|
||||
if (symbol > 0)
|
||||
{
|
||||
e.Graphics.DrawFontImage(symbol, symbolSize, textColor, new RectangleF(NodeX + i * NodeSize.Width + (NodeSize.Width - sf.Width - symbolSize) / 2.0f, NodeY, symbolSize, NodeSize.Height));
|
||||
|
||||
e.Graphics.DrawFontImage(symbol, symbolSize, textColor, new Rectangle(NodeX + i * NodeSize.Width + (int)(NodeSize.Width - sf.Width - symbolSize) / 2, NodeY, symbolSize, NodeSize.Height));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -379,10 +379,10 @@ namespace Sunny.UI
|
||||
if (Symbol > 0 && Image == null)
|
||||
{
|
||||
e.Graphics.DrawFontImage(Symbol, SymbolSize, GetSymbolForeColor(),
|
||||
new RectangleF(
|
||||
(Width - ImageSize.Width) / 2.0f,
|
||||
Padding.Top + (Height - ImageSize.Height - Padding.Top - Padding.Bottom) / 2.0f,
|
||||
ImageSize.Width, ImageSize.Height), SymbolOffset.X, SymbolOffset.Y);
|
||||
new Rectangle(
|
||||
(int)(Width - ImageSize.Width) / 2,
|
||||
Padding.Top + (int)(Height - ImageSize.Height - Padding.Top - Padding.Bottom) / 2,
|
||||
(int)ImageSize.Width, (int)ImageSize.Height), SymbolOffset.X, SymbolOffset.Y);
|
||||
}
|
||||
|
||||
if (Image != null)
|
||||
@ -401,7 +401,7 @@ namespace Sunny.UI
|
||||
if (Symbol > 0 && Image == null)
|
||||
{
|
||||
e.Graphics.DrawFontImage(Symbol, SymbolSize, GetSymbolForeColor(),
|
||||
new RectangleF((Width - allWidth) / 2.0f, (Height - ImageSize.Height) / 2.0f, ImageSize.Width, ImageSize.Height), SymbolOffset.X, SymbolOffset.Y);
|
||||
new Rectangle((int)(Width - allWidth) / 2, (int)(Height - ImageSize.Height) / 2, (int)ImageSize.Width, (int)ImageSize.Height), SymbolOffset.X, SymbolOffset.Y);
|
||||
}
|
||||
|
||||
if (Image != null)
|
||||
@ -472,7 +472,7 @@ namespace Sunny.UI
|
||||
if (Symbol > 0 && Image == null)
|
||||
{
|
||||
e.Graphics.DrawFontImage(Symbol, SymbolSize, GetSymbolForeColor(),
|
||||
new RectangleF(left, top, ImageSize.Width, ImageSize.Height), SymbolOffset.X, SymbolOffset.Y);
|
||||
new Rectangle((int)left, (int)top, (int)ImageSize.Width, (int)ImageSize.Height), SymbolOffset.X, SymbolOffset.Y);
|
||||
}
|
||||
|
||||
if (Image != null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user