using System.Windows.Forms;
using System.Drawing;

public class MouseCapture : Control
{
    public MouseCapture()
    {
        this.BackColor = Color.LightGray;
    }

    // Если перо над элементом, то Capture равно true
    protected override void OnMouseMove(MouseEventArgs e)
    {
        this.Capture = this.ClientRectangle.Contains(e.X, e.Y);
        if (this.Capture == true)
            this.BackColor = Color.Blue;
        else
            this.BackColor = Color.LightGray;
    }
}

