2
I was able to do the entire database part of the login form, so that if the user enters login/password with data that are in the database, he can access.
Only when I open the other form, the login does not close and the most I could was hide it with this.Visible = false;
I want the second form to open and the login to close without the entire application crashing, since with this.close()/close() everything closed!
My login button code looks like this:
Obs: "access" is a boolean variable that I assign when creating the login/password part of the program’s database.
if (acessar == true)
{
MessageBox.Show("Logado com sucesso!");
this.Visible = false;
Form2 novaform = new Form2();
novaform.ShowDialog();
}
else
{
MessageBox.Show("Erro ao logar");
}