How to check and Close the Opened Forms

Nadeemshaik
Posted by Nadeemshaik under C# category on | Points: 40 | Views : 737
 public void CloseForm(Type formType)
{
try
{
foreach (Form form in Application.OpenForms)
{
if (form.GetType().Name == formType.Name)
{
form.Close();
return;
}
}
}
catch (Exception ex)
{
//
}

}

Comments or Responses

Login to post response