I have a condition in which I need to close the application and so I call this.Dispose() when I set a certian flag.
At first I thought it was a problem of calling functions after I call this.Dispose() and so I moved the code to be the last thing called, but I still get a "ArgumentException was unhandled" "Parameter is not valid." on the Application.Run(new myApp()); line.
What am I doing wrong? Did I miss something along the way? Or maybe there is a better way to close the application? Thanks for the help in advance.