close specific child form with specified name in windows application

By Super Man

i will show how you can close the child form using child form name.

            foreach (Form aForm in this.MdiChildren)
            {
                 if (aForm.Name == "Form1")
                 {
                     aForm.Close();
                     break;
                 }
             }

close specific child form with specified name in windows application  (1213 Views)