private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { if (this.DesignMode) { // Do something useful here. } }