This is to Prevent Multiple Instances for a Particular Form in a Windows Application.
bool IsOpen = false; Form1 Frm = new Form1();
if (Application.OpenForms["Form1"] != null)
{
if (Application.OpenForms["Form1"].Text == "Your Form Text")
{
IsOpen = true;
}
if (IsOpen == true)
{
Frm.Focus();
}
}
else
{
IsOpen = true;
Frm.Show();
Frm.Focus();
}
or try this simple code,
Form1 Frm = new Form1();
Frm.ShowDialog(this);