diff --git a/SunnyUI/Controls/UIButton.cs b/SunnyUI/Controls/UIButton.cs index b07c3a07..8a9f607b 100644 --- a/SunnyUI/Controls/UIButton.cs +++ b/SunnyUI/Controls/UIButton.cs @@ -63,7 +63,7 @@ namespace Sunny.UI TabStop = true; Width = 100; Height = 35; - Cursor = Cursors.Hand; + base.Cursor = Cursors.Hand; plainColor = UIStyles.Blue.PlainColor; diff --git a/SunnyUI/Controls/UIVerificationCode.cs b/SunnyUI/Controls/UIVerificationCode.cs index 33dec3b1..27ad81d0 100644 --- a/SunnyUI/Controls/UIVerificationCode.cs +++ b/SunnyUI/Controls/UIVerificationCode.cs @@ -19,6 +19,7 @@ * 2022-06-11: V3.1.9 增加文件说明 * 2023-05-16: V3.3.6 重构DrawString函数 * 2022-05-28: V3.3.7 修改字体缩放时显示 + * 2024-12-12: V3.8.0 可以自定义颜色 #IBABW1 ******************************************************************************/ using System; @@ -38,6 +39,7 @@ namespace Sunny.UI { SetStyleFlags(); fillColor = UIStyles.Blue.PlainColor; + foreColor = UIStyles.Blue.RectColor; Width = 100; Height = 35; } @@ -50,6 +52,7 @@ namespace Sunny.UI { base.SetStyleColor(uiColor); fillColor = uiColor.PlainColor; + foreColor = uiColor.RectColor; } /// @@ -62,6 +65,28 @@ namespace Sunny.UI Invalidate(); } + /// + /// 边框颜色 + /// + [Description("边框颜色"), Category("SunnyUI")] + [DefaultValue(typeof(Color), "80, 160, 255")] + public Color RectColor + { + get => rectColor; + set => SetRectColor(value); + } + + /// + /// 字体颜色 + /// + [Description("字体颜色"), Category("SunnyUI")] + [DefaultValue(typeof(Color), "80, 160, 255")] + public override Color ForeColor + { + get => foreColor; + set => SetForeColor(value); + } + /// /// 绘制填充颜色 /// @@ -137,7 +162,7 @@ namespace Sunny.UI image.SetPixel(x, y, Color.FromArgb(random.Next())); } - using Brush br = new SolidBrush(rectColor); + using Brush br = new SolidBrush(foreColor); g.DrawString(code, fontex, br, image.Width / 2 - sf.Width / 2, image.Height / 2 - sf.Height / 2); return TwistImage(image, true, 3, 5); }