diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe index 413eaeb2..ba5a3c17 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 be2a3512..c6d41eee 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 d3b9d750..e988e830 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 022dd63f..c65580e0 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 8fcf5192..7a087e00 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 cb590b1b..830a747b 100644 --- a/SunnyUI.Demo/Controls/FTextBox.Designer.cs +++ b/SunnyUI.Demo/Controls/FTextBox.Designer.cs @@ -40,11 +40,11 @@ this.uiLine4 = new Sunny.UI.UILine(); this.uiLine5 = new Sunny.UI.UILine(); this.uiRichTextBox1 = new Sunny.UI.UIRichTextBox(); + this.uiContextMenuStrip1 = new Sunny.UI.UIContextMenuStrip(); + this.aaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.uiLine2 = new Sunny.UI.UILine(); this.uiLine3 = new Sunny.UI.UILine(); this.uiTextBox4 = new Sunny.UI.UITextBox(); - this.uiContextMenuStrip1 = new Sunny.UI.UIContextMenuStrip(); - this.aaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.PagePanel.SuspendLayout(); this.uiContextMenuStrip1.SuspendLayout(); this.SuspendLayout(); @@ -230,6 +230,20 @@ 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吧!!!"; + // + // uiContextMenuStrip1 + // + this.uiContextMenuStrip1.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiContextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.aaToolStripMenuItem}); + this.uiContextMenuStrip1.Name = "uiContextMenuStrip1"; + this.uiContextMenuStrip1.Size = new System.Drawing.Size(99, 30); + // + // aaToolStripMenuItem + // + this.aaToolStripMenuItem.Name = "aaToolStripMenuItem"; + this.aaToolStripMenuItem.Size = new System.Drawing.Size(98, 26); + this.aaToolStripMenuItem.Text = "aa"; // // uiLine2 // @@ -273,20 +287,6 @@ "nnyUI技术交流群),请给源码项目点个Star吧!!!"; this.uiTextBox4.Watermark = "水印文字"; // - // uiContextMenuStrip1 - // - this.uiContextMenuStrip1.Font = new System.Drawing.Font("微软雅黑", 12F); - this.uiContextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.aaToolStripMenuItem}); - this.uiContextMenuStrip1.Name = "uiContextMenuStrip1"; - this.uiContextMenuStrip1.Size = new System.Drawing.Size(99, 30); - // - // aaToolStripMenuItem - // - this.aaToolStripMenuItem.Name = "aaToolStripMenuItem"; - this.aaToolStripMenuItem.Size = new System.Drawing.Size(98, 26); - this.aaToolStripMenuItem.Text = "aa"; - // // FTextBox // this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F); diff --git a/SunnyUI/Controls/UITextBox.cs b/SunnyUI/Controls/UITextBox.cs index fd667515..78d0f5d4 100644 --- a/SunnyUI/Controls/UITextBox.cs +++ b/SunnyUI/Controls/UITextBox.cs @@ -84,6 +84,13 @@ namespace Sunny.UI Leave?.Invoke(sender, e); } + protected override void OnEnabledChanged(EventArgs e) + { + base.OnEnabledChanged(e); + edit.BackColor = Enabled ? Color.White : FillDisableColor; + edit.Enabled = Enabled; + } + public override bool Focused { get => edit.Focused; @@ -376,7 +383,7 @@ namespace Sunny.UI set { edit.ReadOnly = value; - edit.BackColor = Color.White; + edit.BackColor = Enabled ? Color.White : FillDisableColor; } } @@ -495,7 +502,7 @@ namespace Sunny.UI base.SetStyleColor(uiColor); if (uiColor.IsCustom()) return; - edit.BackColor = fillColor = Color.White; + edit.BackColor = fillColor = Enabled ? Color.White : FillDisableColor; edit.ForeColor = foreColor = UIFontColor.Primary; if (bar != null) @@ -518,7 +525,7 @@ namespace Sunny.UI protected override void AfterSetFillColor(Color color) { base.AfterSetFillColor(color); - edit.BackColor = color; + edit.BackColor = Enabled ? color : FillDisableColor; } public enum UIEditType