diff --git a/SunnyUI/Controls/UIButton.cs b/SunnyUI/Controls/UIButton.cs index 578ef71a..0ee2f564 100644 --- a/SunnyUI/Controls/UIButton.cs +++ b/SunnyUI/Controls/UIButton.cs @@ -221,7 +221,7 @@ namespace Sunny.UI { if (FillColorGradient) { - if (IsHover || IsPress || Selected) + if (IsHover || IsPress || Selected || Disabled) { base.OnPaintFill(g, path); } diff --git a/SunnyUI/Controls/UIControl.cs b/SunnyUI/Controls/UIControl.cs index c32455a8..3ec1e2be 100644 --- a/SunnyUI/Controls/UIControl.cs +++ b/SunnyUI/Controls/UIControl.cs @@ -49,6 +49,8 @@ namespace Sunny.UI base.MinimumSize = new Size(1, 1); } + public bool Disabled => !Enabled; + /// /// 禁止控件跟随窗体缩放 /// diff --git a/SunnyUI/Controls/UIUserControl.cs b/SunnyUI/Controls/UIUserControl.cs index 9e8a4e52..8c4f7b25 100644 --- a/SunnyUI/Controls/UIUserControl.cs +++ b/SunnyUI/Controls/UIUserControl.cs @@ -50,6 +50,8 @@ namespace Sunny.UI SetStyleFlags(true, false); } + public bool Disabled => !Enabled; + /// /// 禁止控件跟随窗体缩放 ///