this.button1.Click += new EventHandler(button1.Click); this.Paint += new PaintEventHandler(this.MyPaintEventHandler); private void button1_Click(object sender, EventArgs e) { this.Invalidate(); } private void MyPaintEventHandler(object sender, PaintEventArgs e) { //drawing code goes here }