private UserControl currentUserControl; private void button1_Click(object sender, System.EventArgs e) { if (this.currentUserControl != null) { this.panel1.Controls.Remove(currentUserControl); this.currentUserControl = null; } this.currentUserControl = new UserControl1(); this.currentUserControl.Name = "currentUserControl"; this.panel1.Controls.Add(currentUserControl); this.panel1.Controls[0].Dock = DockStyle.Fill; this.currentUserControl.Visible = true; }