I have an application in C # it works normally, but when I click the close button, it closes but it does not stop ... I think it gets in some kind of background, ie your process stays active! and it is only finalized when I click on the visual studio Stop. Is there a 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! will the problem be with regard to hiding the login screen? follow code example
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();
}
}