//Login(); private static void Login() { FrmLogin login = new FrmLogin(); login.StartPosition = FormStartPosition.CenterScreen; if (DialogResult.OK == login.ShowDialog()) { if (login.LoginState == true) { FrmMain main = new FrmMain(); main.ShowDialog(); login.Hide(); } } }
static void OnLoginFormClosed(object sender, FormClosedEventArgs e) { frmLogin.Hide(); program.EndAuthenticate(frmLogin.DialogResult == DialogResult.OK); }