private void viewStudentInformationToolStripMenuItem_Click(object sender, EventArgs e) { if (frmViewStudent1 == null) { frmViewStudent1 = new frmViewStudent(); frmViewStudent1.FormBorderStyle = FormBorderStyle.None; frmViewStudent1.FormClosed += frmViewStudent1_FormClosed; this.DisplayButtons(false); frmViewStudent1.ShowDialog(); } else { frmViewStudent1.Activate(); } }
void frmViewStudent1_FormClosed(object sender, FormClosedEventArgs e) { frmViewStudent1 = null; this.DisplayButtons(true); }