How can I close a .NET form programatically in C#?
Printable View
How can I close a .NET form programatically in C#?
never mind.......
myform.Close();
da...
actually, if that's an MDI application and suppose some exception or you want to quit
so you can use
Environment.Exit(0);
also ;)
Application.Exit();
"Application.Exit"
1) when you use Application.Exit then
Closed and Closing events of form are not invoked. so that you can't test it anyway.
"Environment.Exit"
2) actually the process itself is terminated here.
-Paresh