private void Form1_Load(object sender, EventArgs e) { if (this.Contenedor.Controls.Count > 0) { this.Contenedor.Controls.RemoveAt(0); } Form fh = new Form0() as Form; fh.TopLevel = false; fh.Dock = DockStyle.Fill; this.Contenedor.Controls.Add(fh); this.Contenedor.Tag = fh; fh.Show(); }
private void button1_Click_2(object sender, EventArgs e) { int nj = this.Controls.Count; for (int j = 0; j < nj; j++) { this.Controls.RemoveAt(0); } Form fh = new Form0() as Form; fh.TopLevel = false; fh.Dock = DockStyle.Fill; this.Controls.Add(fh); this.Tag = fh; fh.Show(); }