diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe index d7f74301..e4b531d7 100644 Binary files a/Bin/net40/SunnyUI.Demo.exe and b/Bin/net40/SunnyUI.Demo.exe differ diff --git a/Bin/net40/SunnyUI.dll b/Bin/net40/SunnyUI.dll index 05a3163b..fc75afbd 100644 Binary files a/Bin/net40/SunnyUI.dll and b/Bin/net40/SunnyUI.dll differ diff --git a/Bin/net5.0-windows/SunnyUI.dll b/Bin/net5.0-windows/SunnyUI.dll index 93a39975..8a641e25 100644 Binary files a/Bin/net5.0-windows/SunnyUI.dll and b/Bin/net5.0-windows/SunnyUI.dll differ diff --git a/Bin/net5.0-windows/ref/SunnyUI.dll b/Bin/net5.0-windows/ref/SunnyUI.dll index 05d63bdf..daad9901 100644 Binary files a/Bin/net5.0-windows/ref/SunnyUI.dll and b/Bin/net5.0-windows/ref/SunnyUI.dll differ diff --git a/Bin/netcoreapp3.1/SunnyUI.dll b/Bin/netcoreapp3.1/SunnyUI.dll index 9679db37..821e2bcf 100644 Binary files a/Bin/netcoreapp3.1/SunnyUI.dll and b/Bin/netcoreapp3.1/SunnyUI.dll differ diff --git a/SunnyUI.Demo/Controls/FHeaderButton.Designer.cs b/SunnyUI.Demo/Controls/FHeaderButton.Designer.cs index ac943f8b..86349572 100644 --- a/SunnyUI.Demo/Controls/FHeaderButton.Designer.cs +++ b/SunnyUI.Demo/Controls/FHeaderButton.Designer.cs @@ -181,6 +181,7 @@ namespace Sunny.UI.Demo // uiHeaderButton1 // this.uiHeaderButton1.CircleColor = System.Drawing.Color.RoyalBlue; + this.uiHeaderButton1.CircleHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(255))))); this.uiHeaderButton1.Cursor = System.Windows.Forms.Cursors.Hand; this.uiHeaderButton1.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiHeaderButton1.Location = new System.Drawing.Point(100, 1); @@ -190,6 +191,7 @@ namespace Sunny.UI.Demo this.uiHeaderButton1.Radius = 0; this.uiHeaderButton1.RadiusSides = Sunny.UI.UICornerRadiusSides.None; this.uiHeaderButton1.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None; + this.uiHeaderButton1.ShowCircleHoverColor = true; this.uiHeaderButton1.Size = new System.Drawing.Size(100, 88); this.uiHeaderButton1.Style = Sunny.UI.UIStyle.Custom; this.uiHeaderButton1.Symbol = 61461; diff --git a/SunnyUI/Controls/UIHeaderButton.cs b/SunnyUI/Controls/UIHeaderButton.cs index 1b389ecd..cfbf4db7 100644 --- a/SunnyUI/Controls/UIHeaderButton.cs +++ b/SunnyUI/Controls/UIHeaderButton.cs @@ -17,6 +17,7 @@ * 创建日期: 2021-02-10 * * 2021-02-10: V3.0.1 增加文件说明 + * 2021-03-27: V3.0.2 增加字体图标背景时鼠标移上背景色 ******************************************************************************/ @@ -283,6 +284,24 @@ namespace Sunny.UI } } + [DefaultValue(false)] + [Description("是否显示字体图标鼠标移上背景颜色"), Category("SunnyUI")] + public bool ShowCircleHoverColor { get; set; } + + private Color circleHoverColor = Color.Bisque; + + [DefaultValue(typeof(Color), "Bisque")] + [Description("字体图标鼠标移上背景颜色"), Category("SunnyUI")] + public Color CircleHoverColor + { + get => circleHoverColor; + set + { + circleHoverColor = value; + Invalidate(); + } + } + protected override void OnPaddingChanged(EventArgs e) { base.OnPaddingChanged(e); @@ -397,7 +416,6 @@ namespace Sunny.UI //重绘父类 base.OnPaint(e); - SizeF ImageSize = new SizeF(0, 0); if (Symbol > 0) ImageSize = e.Graphics.GetFontImageSize(Symbol, SymbolSize); @@ -407,7 +425,13 @@ namespace Sunny.UI //字体图标 if (Symbol > 0 && Image == null) { - e.Graphics.FillEllipse(CircleColor, (Width - CircleSize) / 2.0f, Padding.Top, CircleSize, CircleSize); + Color bcColor = CircleColor; + if (ShowCircleHoverColor && IsHover) + { + bcColor = CircleHoverColor; + } + + 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,