Form2 frm=new Form2();
foreach (frm in this.MdiChildren)
{
frm.Close();
}
Form2 frm=new Form2();
foreach (frm in this.MdiChildren)
{
frm.Close();
}
الخطأ في كتابة جملة foreach حيث يجب التصريح عن المتغير frm داخل الجملة وليس خارجها.
foreach(Form2 frm in this.MdiChildren) {
frm.Close();
}جزاك الله خيرا