protected override void OnMouseLeave(EventArgs e) { //This will check if control got the focus //If not thats the only it will remove the focus color if (!isFocused) { isHovered = false; } Invalidate(); base.OnMouseLeave(e); }