It almost seems as though Microsoft wants it to be illegal to show a form after the user chooses Application.Exit, yet that is exactly what I need to do.
I have a cleanup routine that deletes old articles from a database, and like to show a progress dialog while this is happening, just like Outlook's emptying deleted items dialog.
However, no matter what I try it won't work! Basically my first attempt was to simply show this dialog in the FormClosing event handler of my main form, which "works", but as soon as it closes I get a fatal exception, something about a collection being changed and invalidating an enumerator... some Boolean collection somewhere. *shrug*
Next I tried simply showing the dialog after the Application.Run(mainForm) completes, but as soon as the dialog is created it's immediately destroyed for some reason! I even tried a second Application.Run( cleanupDialog ) but with the same result!!
What else can I do?!