diff --git a/SunnyUI/Controls/UITextBox.cs b/SunnyUI/Controls/UITextBox.cs index 91ecf1ef..ba678a52 100644 --- a/SunnyUI/Controls/UITextBox.cs +++ b/SunnyUI/Controls/UITextBox.cs @@ -413,7 +413,16 @@ namespace Sunny.UI { base.OnEnabledChanged(e); edit.BackColor = GetFillColor(); - edit.Visible = Enabled; + edit.Visible = !styleCustomMode; + edit.Enabled = Enabled; + } + + protected override void SetStyleCustom(bool needRefresh = true) + { + base.SetStyleCustom(needRefresh); + edit.Visible = !styleCustomMode; + edit.Enabled = Enabled; + Invalidate(); } public override bool Focused => edit.Focused; @@ -1271,7 +1280,7 @@ namespace Sunny.UI e.Graphics.DrawFontImage(Symbol, SymbolSize, SymbolColor, new Rectangle(4 + symbolOffset.X, (Height - SymbolSize) / 2 + 1 + symbolOffset.Y, SymbolSize, SymbolSize), SymbolOffset.X, SymbolOffset.Y); } - if (Text.IsValid() && !Enabled) + if (styleCustomMode && Text.IsValid() && !Enabled) { string text = Text; if (PasswordChar > 0) diff --git a/SunnyUI/Controls/UIUserControl.cs b/SunnyUI/Controls/UIUserControl.cs index a20b93d8..260b1b6d 100644 --- a/SunnyUI/Controls/UIUserControl.cs +++ b/SunnyUI/Controls/UIUserControl.cs @@ -808,7 +808,7 @@ namespace Sunny.UI [Browsable(false)] public new bool AutoScroll { get; set; } = false; - protected void SetStyleCustom(bool needRefresh = true) + protected virtual void SetStyleCustom(bool needRefresh = true) { _style = UIStyle.Custom; if (needRefresh) Invalidate();