if (this.panel2.Controls.Count > 0)
this.panel2.Controls.RemoveAt(0);
Form f = formhi as Form;
f.TopLevel = false;
f.Dock = DockStyle.Fill;
this.panel2.Controls.Add(f);
this.panel2.Tag = f;
f.Show();
f.Closed += (s, args) => this.Close();