Try this code to close perticular open form or all open form.......
foreach (Form form in Application.OpenForms)
{
if (form.Name == "Login")
{
form.Close();
}
// /* to close all open form */
// form .Close();
}
foreach (Form form in Application.OpenForms)
{
if (form.Name == "Login")
{
form.Close();
}
// /* to close all open form */
// form .Close();
}
No comments:
Post a Comment