Wnidows forms Closing
In my application, Iam not used mdi concept. So in my application has different forms. So, I want to close all the forms which is opened before opening the form.
Hi, I not able to close the form from another from.
please give me a solution For my problem.
Roei BarPosted Sep 26, 2009, 1:34 PM
you need 1 modification:
Master BillaPosted Sep 26, 2009, 11:18 AM
You can close the all opened form by this code
private void CloseAll()
{
FormCollection colection = System.Windows.Forms.Application.OpenForms;
for (int i = 0; i < colection.Count; i++)
{
Form formcommon = colection[i];
formcommon.Close();
}
}
thank you