Monday, May 27, 2013

close all open forms that formBorderStyle is None


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

net4.rmkrishnan.net

Use only what you need, Reduce global warming


No comments:

Post a Comment