提交当前本机整理版本
This commit is contained in:
@@ -119,4 +119,32 @@ namespace Lskj.Main.Control
|
||||
if (ClientRectangle.Contains(PointToClient(System.Windows.Forms.Control.MousePosition))) return;
|
||||
_isHover = false;
|
||||
//BackColor = _normalBack;
|
||||
|
||||
btn_icon.BackgroundImage = _imgDefault;
|
||||
this.BackgroundImage = null;
|
||||
Invalidate();
|
||||
Update();
|
||||
}
|
||||
private void BindHover(System.Windows.Forms.Control ctl)
|
||||
{
|
||||
ctl.MouseEnter += HoverEnter;
|
||||
ctl.MouseLeave += HoverLeave;
|
||||
}
|
||||
/* ===== 角标定位 ===== */
|
||||
protected override void OnResize(EventArgs e)
|
||||
{ base.OnResize(e); RepositionBadge(); }
|
||||
|
||||
private void RepositionBadge()
|
||||
{
|
||||
if (!badgeDot.Visible) return;
|
||||
|
||||
const int SAFE = 2; // 距离边缘 2px
|
||||
//badgeDot.Location = new Point(
|
||||
// Math.Min(btn_icon.Right - badgeDot.Width / 2, Width - badgeDot.Width - SAFE),
|
||||
// Math.Max(btn_icon.Top - badgeDot.Height / 2, SAFE));
|
||||
|
||||
/* 数字已 Dock/Size 居中,无需再调位置,但保证层级 */
|
||||
badgeDot.BringToFront();
|
||||
badgeNum.BringToFront();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user