P
Peter D. Dunlap
I have an application in which the constructor for the main form pops
up a user name/password dialog and validates the user. If the user
hits the Cancel button in this dialog, I want to close the application
without ever showing the main form.
// this code is in the main form constructor
if (formLogin.ShowDialog() == DialogResult.Cancel)
{
// close the app here
}
// more code to initialize the app is here
For the code I've tried:
Application.Exit();
return;
and
Close();
return;
Neither one works, it still shows the main form and does not exit.
Any suggestions?
Pete Dunlap
up a user name/password dialog and validates the user. If the user
hits the Cancel button in this dialog, I want to close the application
without ever showing the main form.
// this code is in the main form constructor
if (formLogin.ShowDialog() == DialogResult.Cancel)
{
// close the app here
}
// more code to initialize the app is here
For the code I've tried:
Application.Exit();
return;
and
Close();
return;
Neither one works, it still shows the main form and does not exit.
Any suggestions?
Pete Dunlap