c# – check if form exist and open it if not

FormType myForm = Application.OpenForms.OfType<FormType>().FirstOrDefault();

if(myForm != null)

{

myForm.Show();

}

else

{

myForm = new FromType();

myForm.Show();

}

Advertisements