Hello!
private void frmMain_Closing(object sender, CancelEventArgs e){
e.Cancel = true;
this.Visible = false;
}
So if you click on the "Chancel" Button in the upper right corner, the Application will not be closed.
-> The problem is, that I can't restart or shut down my computer, while the Application is running!
Any resons for that?
Thanks
SBCJB

sanoj kumar39 reputationPosted Jul 23, 2006, 2:33 AM EDT
So closing will not be taken place only hiding.
Instead of that you can use a button or a menuItem for explicit closing or
you can use a variable value to check abnormal termination. using that value
you can use that variable value to identify whether it is to be closed or not.
Sebastian Banz8 reputationPosted Jul 26, 2006, 11:05 PM EDT
I thought about using the "sender" to identify if windows is closing the application or a user, but without result. So I will use a menu entry instead of the Closing Button.