The problem i am facing is that the buttons on the parent form are coming on the top of the child forms and not hiding behind
Hello,
I am working on a windows application in C#.NET 2.0.
I am using an MDI form with multiple buttons on it. Clicking on the buttons opens a child form.
Now, the problem i am facing is that the buttons on the parent form are coming on the top of the child forms and not hiding behind. I need the child form to cover the controls on the MDI form.
Would appreciate if someone can guide me in the correct direction.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Nilanka DharmadasaRank #1,875 · 794 reputationPosted Nov 5, 2009, 8:27 PM EST
Hope you can get a help from this code.
Hi friend,
try this.
Form frmTemp = new Form();
frmTemp.MdiParent = this;
frmTemp.Text = "MDI Child";
foreach (Control x in this.Controls)
{
string type = x.GetType().ToString();
if (!type.Equals("System.Windows.Forms.MdiClient"))
x.Hide();
}
frmTemp.Show();
Nilanka DharmadasaRank #1,875 · 794 reputationPosted Nov 5, 2009, 8:25 PM EST
try this.
Form frmTemp = new Form();
frmTemp.MdiParent = this;
frmTemp.Text = "Window#";
foreach (Control x in this.Controls)
{
string type = x.GetType().ToString();
if (!type.Equals("System.Windows.Forms.MdiClient"))
x.Hide();
}
frmTemp.Show();