How to check whether Form is Opened or not

Nadeemshaik
Posted by Nadeemshaik under C# category on | Points: 40 | Views : 666
public bool IsFormOpen(Type formType)
{
bool bl = true;
try
{
foreach (Form form in Application.OpenForms)
if (form.GetType().Name == formType.Name)
{
bl = true;
}
else
{
bl = false;
}
}
catch (Exception ex)
{
//
}
return bl;
}

Comments or Responses

Login to post response