So I can't seem to completely开发者_高级运维 exit the application, I want this to happen when the user clicks the (x) button. is there a certain command like application.exit I can put somewhere (maybe FormClosed()?)
Thank you!
After closing the last form, the application should exit on its own.
If it isn't, you probably have some other code which is still running.
Pause the program in a debugger and cehck what it's doing.
You need an Event Handler that runs after that particular MDIParent closes. Example:
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
Application.Exit();
}
精彩评论