Saturday, October 11, 2008

GetType(),typeof,obj is Form3

foreach(Form frm in mdiParent.MdiChildren) //where mdiParent is the MDI
Container...
{
if(form.GetType() == typeof(FormToClose)) //where FormToClose is Form
you want to close...
form.Close();
}


foreach (Form obj in MdiChildren)
{
if (obj is Form3)
{
obj.WindowState = FormWindowState.Maximized;
}
}

No comments: