I am working on a windows application form in visual studio 2012 where I am stuck in the UI design part. Actually, I am trying to open the child form in front of all the control objects (panel, table layout panel). This the parent form
When I open a child form all the objects of parent form go back
Here is the code inside my mdi parent form
frmControlAccount x;
private void controlToolStripMenuItem_Click(object sender, EventArgs e)
{
if (x == null || x.IsDisposed)//to avoid multiple opening of forms
{
x = new frmControlAccount();
x.MdiParent = this;
x.Show();
}
else
{
x.Focus();
x.BringToFront();
}
}
Since the form was not showing I tried this code too
private void MainPage_MdiChildActivate(object sender, EventArgs e)
{
if (ActiveMdiChild != null)
{
panel1.SendToBack();
picHomepage.SendToBack();
}
else
{
panel1.BringToFront();
picHomepage.BringToFront();
}
}