for (var i = Application.OpenForms.Count - 1; i >= 0;i-- )
{
var f = Application.OpenForms[i];
if (f.Name != "frmMain" && f.FormBorderStyle == System.Windows.Forms.FormBorderStyle.None)
{
f.Close();
//break;
}
}Muthukrishnan Ramasamy
Use only what you need, Reduce global warming
Thank you!
I just remove the f.Name != "frmMain" . because in each time the value of f.Name was the same and equals "frmMain". I dont know why?!
for (var i = Application.OpenForms.Count - 1; i >= 0; i--)
{
var f = Application.OpenForms[i];
if (f.FormBorderStyle == System.Windows.Forms.FormBorderStyle.None)
{
f.Close();
}
}
امیدوارم همیشه بروز باشید I hope always be up2date
No comments:
Post a Comment