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.
Nilanka DharmadasaPosted Nov 6, 2009, 1:27 AM
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 DharmadasaPosted Nov 6, 2009, 1:25 AM
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();