Hello Pawan,
There is a problem with your code in that as soon as you set the MDIParent, the fc immediately becomes an MDI child form. But as soon as you set Panel 2 as the parent, MDIParent is set to null and fc is no longer an MDI child.
fc.MdiParent = this;
fc.Parent = this.splitContainer1.Panel2;
What you need to do is iterate through the forms in the controls collection for Panel2 and close each form as follows.
foreach (Form childForm in this.splitContainer1.Panel2.Controls)
{
childForm.Close();
}
Form1 fc = new Form1();
fc.TopLevel = false;
fc.Parent = this.splitContainer1.Panel2;
fc.StartPosition = FormStartPosition.CenterParent;
fc.FormBorderStyle = FormBorderStyle.None;
fc.BackColor = Color.Green;
fc.Location = new System.Drawing.Point(0, 70);
fc.ShowInTaskbar = false;
fc.BringToFront();
fc.Show();
I hope this helps you.
Jason.