diff --git a/Bin/SunnyUI.dll b/Bin/SunnyUI.dll index ed5c4a84..50a0d96c 100644 Binary files a/Bin/SunnyUI.dll and b/Bin/SunnyUI.dll differ diff --git a/Bin/SunnyUI.pdb b/Bin/SunnyUI.pdb index 562c6a27..24c9e447 100644 Binary files a/Bin/SunnyUI.pdb and b/Bin/SunnyUI.pdb differ diff --git a/SunnyUI.Demo/Bin/SunnyUI.dll b/SunnyUI.Demo/Bin/SunnyUI.dll index ed5c4a84..50a0d96c 100644 Binary files a/SunnyUI.Demo/Bin/SunnyUI.dll and b/SunnyUI.Demo/Bin/SunnyUI.dll differ diff --git a/SunnyUI/Forms/UIForm.cs b/SunnyUI/Forms/UIForm.cs index a500cf22..057b9abf 100644 --- a/SunnyUI/Forms/UIForm.cs +++ b/SunnyUI/Forms/UIForm.cs @@ -664,23 +664,30 @@ namespace Sunny.UI if (FormBorderStyle == FormBorderStyle.None) { bool inControlBox = e.Location.InRect(ControlBoxRect); + bool inMaxBox = e.Location.InRect(MaximizeBoxRect); + bool inMinBox = e.Location.InRect(MinimizeBoxRect); + bool isChange = false; + if (inControlBox != InControlBox) { InControlBox = inControlBox; - Invalidate(); + isChange = true; } - bool inMaxBox = e.Location.InRect(MaximizeBoxRect); if (inMaxBox != InMaxBox) { InMaxBox = inMaxBox; - Invalidate(); + isChange = true; } - bool inMinBox = e.Location.InRect(MinimizeBoxRect); if (inMinBox != InMinBox) { InMinBox = inMinBox; + isChange = true; + } + + if (isChange) + { Invalidate(); } } @@ -691,6 +698,13 @@ namespace Sunny.UI } } + protected override void OnMouseLeave(EventArgs e) + { + base.OnMouseLeave(e); + InControlBox = InMaxBox = InMinBox = false; + Invalidate(); + } + private bool InControlBox, InMaxBox, InMinBox; ///