private void btnLogin_Click(object sender, EventArgs e) { labelError.Text = labelWaring.Text = ""; if (!rightuser) { labelWaring.Text = "Sai tên đăng nhập"; } else if (dbac.CorectUser(txtUserName.Text, txtPassword.Text)) { if (MessageBox.Show("Đăng nhập thành công", "Log in", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK) { Main main = new Main(); main.Show(); this.Hide(); } } else { labelError.Text = "Sai mật khẩu"; } }