if (userDlg.ShowDialog(this) == DialogResult.Cancel)
But when I run the code, the application is not exiting when I click the cancel button on the userDlg dialog. Stepping through in the debugger it's hitting the Application.Exit(); line ok, but just carrying on!
So how can I get the program to terminate (neatly!) at this point?
Thanks in advance,