Hi Jim,
You can use the MdiChildren property of the Parent Container Form. Here is some sample code:
MyChildForm childForm
foreach (Form frm in this.MdiChildren)
{
if (frm is MyChildForm)
{
childForm = (MyChildForm)frm;
childForm.Close();
break;
}
}
>All,
>
> I have a MDI application with a menu. One of the options on the menu is Window. A sub option of the Window menu is close which will close the Active child form. If there is not a child form I get a nullreference exception error. What is the best way to test for a child window?
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi