Hi,
I have got some code that at startup checks for the existence of a file, if it finds the particular file then it opens another form.
If it doesn't find the particular file then it shows a messagebox asking whether or not to enter some data, answer YES or NO.
When the user hits the NO button it displays a message that the program will now exit but the program does not exit, the StartUpForm appears on the desktop.
Here is the code:-
InitializeComponent();
string path=System.IO.Path.Combine(Application.StartupPath, "SUsettings.ini");
if (System.IO.File.Exists(path))
{
MainProg form = new MainProg();
form.ShowDialog();
}
else
{
DialogResult result = MessageBox.Show("You need to enter your Flickr ID. Do you want to do this now?",
"Flickr ID Required",
MessageBoxButtons.YesNo);
if (result == DialogResult.No)
{
MessageBox.Show("The program will now exit");
Application.Exit();
}
if (result == DialogResult.Yes)
{
MessageBox.Show("you want to carry on");
}
}
Why is the Application.Exit() bit not doing it's job?
Kind regards..,
MT ;)