0
I have an application in C# it works normally, but when I click the button to close, it closes but it does not stop ... I think it is in some kind of background, ie your process remains active! and it’s only finished when I click on the Stop from the visual studio. Is there any way to end this process when I click the close button, and why is this error occurring?
When the user runs the program it opens a login screen! If the company is not registered it hides the login screen and opens the company screen! if the company is registered it hides the login screen and opens the menu! would the problem be with hiding the login screen? follows example of the code
public Login()
{
Inicia();
}
private void Inicia() {
bool ValidaEmpresa = new ConEmpresa().JaEstaCadastrada();
// Se ValidaEmpresa for true é porque já esta cadastrada!
if (ValidaEmpresa)
{
// Carrega o menu
MenuADM frm = new MenuADM();
this.Hide();
frm.ShowDialog();
this.Close();
}
else
{
Empresa frm = new Empresa(true);
this.Hide();
frm.ShowDialog();
// Apos cadastrar a empresa abre o menu
MenuADM frm = new MenuADM();
frm.ShowDialog();
this.Close();
}
}