private void menuLogin_Click(object sender, EventArgs e) { if (frmLogin == null) { frmLogin = new FormLogin(); frmLogin.FormClosed += new FormClosedEventHandler(frmLogin_fromClosed); frmLogin.ShowDialog(); } else { frmLogin.Activate(); } }
void frmLogin_fromClosed(object sender, FormClosedEventArgs e) { frmLogin = null; }