private void mnuAccVariables_Click(object sender, EventArgs e) { MyForm f = new MyForm(); f = (MyForm)Application.OpenForms["frmAccVariable"]; if (f != null) { f.BringToFront(); } else { Accounts.frmAccVariable f1 = new Accounts.frmAccVariable(); f1.Show(this); } // new Account.frmAccVariable().Show(this); }
public static void OpenForm(Form Parent, MyForm frm, bool isDialog) { if (isDialog) { frm.ShowDialog(); } else { MyForm f = new MyForm(); f = (MyForm)Application.OpenForms[frm.Name]; if (f != null) { f.BringToFront(); } else { //frm f1 = new frmChangePassword(); frm.Show(Parent); } } }