diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe index 07200793..afb31860 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 fe25e654..31dfc256 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 04aa57dd..56c31233 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 53efeec9..e99b5985 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 64307fa3..b86a7d93 100644 Binary files a/Bin/netcoreapp3.1/SunnyUI.dll and b/Bin/netcoreapp3.1/SunnyUI.dll differ diff --git a/SunnyUI.Demo/Controls/FTextBox.Designer.cs b/SunnyUI.Demo/Controls/FTextBox.Designer.cs index 5e7bed47..c356e2f6 100644 --- a/SunnyUI.Demo/Controls/FTextBox.Designer.cs +++ b/SunnyUI.Demo/Controls/FTextBox.Designer.cs @@ -80,6 +80,7 @@ this.uiIntegerUpDown1.Size = new System.Drawing.Size(150, 29); this.uiIntegerUpDown1.TabIndex = 2; this.uiIntegerUpDown1.Text = "_uiIntegerUpDown1"; + this.uiIntegerUpDown1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; // // uiTextBox1 // @@ -95,6 +96,7 @@ this.uiTextBox1.Padding = new System.Windows.Forms.Padding(5); this.uiTextBox1.Size = new System.Drawing.Size(221, 29); this.uiTextBox1.TabIndex = 3; + this.uiTextBox1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; this.uiTextBox1.Watermark = "水印文字"; // // uiLabel1 @@ -137,6 +139,7 @@ this.uiTextBox2.Size = new System.Drawing.Size(221, 29); this.uiTextBox2.TabIndex = 5; this.uiTextBox2.Text = "5"; + this.uiTextBox2.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; this.uiTextBox2.Type = Sunny.UI.UITextBox.UIEditType.Integer; this.uiTextBox2.Watermark = "水印文字"; // @@ -166,6 +169,7 @@ this.uiTextBox3.Padding = new System.Windows.Forms.Padding(5); this.uiTextBox3.Size = new System.Drawing.Size(221, 29); this.uiTextBox3.TabIndex = 7; + this.uiTextBox3.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; this.uiTextBox3.Type = Sunny.UI.UITextBox.UIEditType.Double; this.uiTextBox3.Watermark = "水印文字"; // @@ -179,6 +183,7 @@ this.uiDoubleUpDown1.Size = new System.Drawing.Size(150, 29); this.uiDoubleUpDown1.TabIndex = 14; this.uiDoubleUpDown1.Text = "uiDoubleUpDown1"; + this.uiDoubleUpDown1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; this.uiDoubleUpDown1.Value = 0D; // // uiLine1 @@ -230,6 +235,7 @@ this.uiRichTextBox1.Text = "Blog: https://www.cnblogs.com/yhuse\nGitee: https://gitee.com/yhuse/SunnyUI\nGitHub" + ": https://github.com/yhuse/SunnyUI\nSunnyUI.Net 系列文章目录\n欢迎交流,QQ群: 56829229 (SunnyU" + "I技术交流群),请给源码项目点个Star吧!!!"; + this.uiRichTextBox1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; // // uiContextMenuStrip1 // @@ -285,11 +291,11 @@ this.uiTextBox4.Text = "Blog: https://www.cnblogs.com/yhuse\r\nGitee: https://gitee.com/yhuse/SunnyUI\r\nGitH" + "ub: https://github.com/yhuse/SunnyUI\r\nSunnyUI.Net 系列文章目录\r\n欢迎交流,QQ群: 56829229 (Su" + "nnyUI技术交流群),请给源码项目点个Star吧!!!"; + this.uiTextBox4.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; this.uiTextBox4.Watermark = "水印文字"; // // FTextBox // - this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.ClientSize = new System.Drawing.Size(800, 565); this.Name = "FTextBox"; diff --git a/SunnyUI/Controls/UIPanel.cs b/SunnyUI/Controls/UIPanel.cs index 33469971..e2f79942 100644 --- a/SunnyUI/Controls/UIPanel.cs +++ b/SunnyUI/Controls/UIPanel.cs @@ -602,18 +602,14 @@ namespace Sunny.UI /// 文字对齐方向 /// [Description("文字对齐方向"), Category("SunnyUI")] - [DefaultValue(ContentAlignment.MiddleCenter)] public ContentAlignment TextAlignment { get => _textAlignment; set { - if (_textAlignment != value) - { - _textAlignment = value; - TextAlignmentChange?.Invoke(this, value); - Invalidate(); - } + _textAlignment = value; + TextAlignmentChange?.Invoke(this, value); + Invalidate(); } } diff --git a/SunnyUI/Controls/UITextBox.cs b/SunnyUI/Controls/UITextBox.cs index 735f2098..655313f6 100644 --- a/SunnyUI/Controls/UITextBox.cs +++ b/SunnyUI/Controls/UITextBox.cs @@ -72,6 +72,7 @@ namespace Sunny.UI bar.ValueChanged += Bar_ValueChanged; edit.MouseWheel += OnMouseWheel; bar.MouseEnter += Bar_MouseEnter; + base.TextAlignment = ContentAlignment.MiddleLeft; SizeChange();