diff --git a/Bin/SunnyUI.Demo.exe b/Bin/SunnyUI.Demo.exe index 2d34344b..643f37a2 100644 Binary files a/Bin/SunnyUI.Demo.exe and b/Bin/SunnyUI.Demo.exe differ diff --git a/Bin/SunnyUI.dll b/Bin/SunnyUI.dll index 67ff38bf..eba15a47 100644 Binary files a/Bin/SunnyUI.dll and b/Bin/SunnyUI.dll differ diff --git a/SunnyUI/Controls/UIDoubleUpDown.designer.cs b/SunnyUI/Controls/UIDoubleUpDown.designer.cs index fb7b67f6..28088b63 100644 --- a/SunnyUI/Controls/UIDoubleUpDown.designer.cs +++ b/SunnyUI/Controls/UIDoubleUpDown.designer.cs @@ -43,7 +43,7 @@ this.btnDec.Margin = new System.Windows.Forms.Padding(0); this.btnDec.MinimumSize = new System.Drawing.Size(1, 1); this.btnDec.Name = "btnDec"; - this.btnDec.Padding = new System.Windows.Forms.Padding(26, 0, 0, 0); + this.btnDec.Padding = new System.Windows.Forms.Padding(26, 4, 0, 0); this.btnDec.RadiusSides = ((Sunny.UI.UICornerRadiusSides)((Sunny.UI.UICornerRadiusSides.LeftTop | Sunny.UI.UICornerRadiusSides.LeftBottom))); this.btnDec.Size = new System.Drawing.Size(29, 29); this.btnDec.Symbol = 61544; @@ -61,7 +61,7 @@ this.btnAdd.Margin = new System.Windows.Forms.Padding(0); this.btnAdd.MinimumSize = new System.Drawing.Size(1, 1); this.btnAdd.Name = "btnAdd"; - this.btnAdd.Padding = new System.Windows.Forms.Padding(26, 0, 0, 0); + this.btnAdd.Padding = new System.Windows.Forms.Padding(26, 3, 0, 0); this.btnAdd.RadiusSides = ((Sunny.UI.UICornerRadiusSides)((Sunny.UI.UICornerRadiusSides.RightTop | Sunny.UI.UICornerRadiusSides.RightBottom))); this.btnAdd.Size = new System.Drawing.Size(29, 29); this.btnAdd.Symbol = 61543; diff --git a/SunnyUI/Controls/UIIntegerUpDown.designer.cs b/SunnyUI/Controls/UIIntegerUpDown.designer.cs index 34aa2c60..4faa1d7b 100644 --- a/SunnyUI/Controls/UIIntegerUpDown.designer.cs +++ b/SunnyUI/Controls/UIIntegerUpDown.designer.cs @@ -43,7 +43,7 @@ this.btnDec.Margin = new System.Windows.Forms.Padding(0); this.btnDec.MinimumSize = new System.Drawing.Size(1, 1); this.btnDec.Name = "btnDec"; - this.btnDec.Padding = new System.Windows.Forms.Padding(26, 0, 0, 0); + this.btnDec.Padding = new System.Windows.Forms.Padding(26, 4, 0, 0); this.btnDec.RadiusSides = ((Sunny.UI.UICornerRadiusSides)((Sunny.UI.UICornerRadiusSides.LeftTop | Sunny.UI.UICornerRadiusSides.LeftBottom))); this.btnDec.Size = new System.Drawing.Size(29, 29); this.btnDec.Symbol = 61544; @@ -61,7 +61,7 @@ this.btnAdd.Margin = new System.Windows.Forms.Padding(0); this.btnAdd.MinimumSize = new System.Drawing.Size(1, 1); this.btnAdd.Name = "btnAdd"; - this.btnAdd.Padding = new System.Windows.Forms.Padding(26, 0, 0, 0); + this.btnAdd.Padding = new System.Windows.Forms.Padding(26, 3, 0, 0); this.btnAdd.RadiusSides = ((Sunny.UI.UICornerRadiusSides)((Sunny.UI.UICornerRadiusSides.RightTop | Sunny.UI.UICornerRadiusSides.RightBottom))); this.btnAdd.Size = new System.Drawing.Size(29, 29); this.btnAdd.Symbol = 61543; diff --git a/SunnyUI/Controls/UISymbolButton.cs b/SunnyUI/Controls/UISymbolButton.cs index 7f7e28c9..ed54d99f 100644 --- a/SunnyUI/Controls/UISymbolButton.cs +++ b/SunnyUI/Controls/UISymbolButton.cs @@ -166,6 +166,12 @@ namespace Sunny.UI } } + protected override void OnPaddingChanged(EventArgs e) + { + base.OnPaddingChanged(e); + Invalidate(); + } + protected override void OnPaint(PaintEventArgs e) { //重绘父类 @@ -195,14 +201,18 @@ namespace Sunny.UI if (Symbol > 0 && Image == null) { e.Graphics.DrawFontImage(Symbol, SymbolSize, color, - new RectangleF((Width - ImageSize.Width) / 2.0f, (Height - ImageSize.Height) / 2.0f, - ImageSize.Width, ImageSize.Height)); + new RectangleF( + (Width - ImageSize.Width) / 2.0f, + Padding.Top + (Height - ImageSize.Height - Padding.Top - Padding.Bottom) / 2.0f, + ImageSize.Width, ImageSize.Height)); } if (Image != null) { - e.Graphics.DrawImage(Image, (Width - Image.Width) / 2.0f, (Height - Image.Height) / 2.0f, - ImageSize.Width, ImageSize.Height); + e.Graphics.DrawImage(Image, + (Width - ImageSize.Width) / 2.0f, + Padding.Top + (Height - ImageSize.Height - Padding.Top - Padding.Bottom) / 2.0f, + ImageSize.Width, ImageSize.Height); } } }