I have a login form that runs after the main form login is accepted, and this form of login is hidden, but when I close the main form, the program is still running. i used this.close() but after login main form is closed!
I want to leave the application when the main form is closed
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);
}