Hi all,
I'm new to this forum. I have three forms, the first one is the base form. The first form opens up a second and the second opens up a third. What I want to do is close the second when the third opens and allow the third to be on top of the first in a .showdialog(this) manner. Any suggestions?
Thanks,
Gene BuryakovskyPosted Feb 21, 2008, 2:53 PM
Niradhip ChakrabortyPosted Feb 21, 2008, 2:30 PM
It can be done easily by following way:
U please make the firstform is parent form and remaining two form as child form.
Then u open the 2nd form and before opening the 3rd form from 2nd form add the following code.
foreach (Form f in this.MdiChildren)
{
f.Close();
}
and then open the third form
like this:
frm3 frmopen = new frm3();
frmopen.MdiParent = this;
frmopen.Show();
Dnt forget to make the first form as parent form