3
Hello, I’m using C#, to create a login system. And I would like to know some formula to close this login window without stopping the application. I used this. Hide(); to hide the form, but when closing the program it keeps running only hidden. Can anyone help me? Remembering that when typing the user and the correct password will call another form.
That’s the code I’m using:
if (usuarioTextBox.Text == "Administração" && senhaTextBox.Text == "@dmin321")
{
MessageBox.Show("Acesso Permitido");
this.Hide();
Form2 novoFormulario = new Form2();
novoFormulario.Show();
}
When closing the application, the form you had hidden with
this.Hide()
, keep rolling? Can you show me this?– vinibrsl
@Vinicius I think when he says when closing the program it continues running in fact he wants to say when closing the second form, the first form continues running . I guess that’s it :-)
– igventurelli
That’s right, Igor Venturelli
– Tec.Alves
Cool @Tec.Alves . Have you seen my answer? I believe it’s what you need.
– igventurelli
i would like the friend leo Longhi, the main form of the application is Form1, and before running it, call the formlogin and validate the user, if it is valid, just continue with the application, if not, close.
– Rovann Linhalis