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
Sebastian BanzPosted Jul 27, 2006, 3:05 AM
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.
sanoj kumarPosted Jul 23, 2006, 6:33 AM
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.