private void changePasswordToolStripMenuItem_Click(object sender, EventArgs e) { if (Application.OpenForms.OfType<frmChangePassword>().Count() >= 1) { Application.OpenForms.OfType<frmChangePassword>().First().Activate(); } else { frmChangePassword d = new frmChangePassword(); d.MdiParent = this; d.Show(); } }
private void changePasswordToolStripMenuItem_Click(object sender, EventArgs e) { OpenForm(frmChangePassword); } private void OpenForm(Form frm) { if (Application.OpenForms.OfType<frm>().Count() >= 1) { Application.OpenForms.OfType<frm>().First().Activate(); } else { frm = new frm(); frm.MdiParent = this; frm.Show(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)