2
private void BtnEntrar_Click(object sender, EventArgs e)
{
string login = txtLogin.Text;
Conta conta = new Conta();
try
{
BLL bll = new BLL();
conta = bll.SelectContaByLogin(login);
if(txtSenha.Text == conta.Senha)
{
TelaDeLogin form1 = new TelaDeLogin();
form1.Close();
TelaInicial form2 = new TelaInicial();
form2.ShowDialog();
} else
{
MessageBox.Show("Login ou senha incorretos.");
}
}
catch(Exception ex)
{
throw ex;
}
}
I’m doing a Login and Password system in Visual Studio with C#, and I need to close the form
Login when the user logs in.
The part about opening the form
Home Screen works, but the form1.Close()
does not work. I tried Hide()
, tried this.Close()
, but it’s not closing either.
this.Hide()
doesn’t work?– Focos
Do me a favor. If none of the answers to the below solve your problem post event code
onClose
formTelaDeLogin
.– Augusto Vasques