/// <summary> /// Helper form so that above form only has one instance at a time. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void vf_FormClosed(object sender, FormClosedEventArgs e) { vf = null; }
private void newVisitToolStripMenuItem1_Click_1(object sender, EventArgs e) { if (UserSecurityController.AdminLoggedIn != null) { MessageBox.Show("You are not authorized to access this. ", "Access denied"); } else { if (vf == null) { vf = new VisitForm(); vf.MdiParent = this; vf.FormClosed += new FormClosedEventHandler(vf_FormClosed); vf.Show(); } else { vf.Activate(); } } }