You paint a control by overriding the OnPaint method and drawing to the graphics object supplied.

Code:
class DrawOnMe : Panel
{
    protected override OnPain(PaintEventArgs e)
    {
        using (Graphics g = e.Graphics)
        {
            rect = this.ClientRectangle;
            g.FillRectangle(Brushes.Pink, rect);
        }
    }
}