-1
我有一个登录表单,主窗体登录被接受后运行,并且这种登录形式是隐藏的,但是当我关闭主窗体时,程序仍然是运行。 我使用this.close()但登录后主窗体关闭!当主窗体关闭时,我想离开应用程序
我要离开这个应用程序时,主窗体关闭
UserBLL x = new UserBLL();
if (x.loginAcount(TextBox1.Text, TextBox2.Text) == true)
{
MessageBox.Show("You are successfully logged in", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.Hide();
MainForm frm = new MainForm();
frm.ShowDialog();
}
else
{
MessageBox.Show("Username or password is incorrect", "Info", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
你想完全退出应用程序吗? – Saif
@saif是的,我想在主窗体关闭时离开应用程序 –