Application.Run throws ArgumentException was unhandled
问题 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 an "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?