* UIForm:修改标题栏按钮背景色刷新

This commit is contained in:
Sunny 2020-07-01 23:23:31 +08:00
parent 7e521f596d
commit d0143bc63c
4 changed files with 18 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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;
/// <summary>