Is there a better way to handle the task of doing something after the user has chosen to exit a WinForms program than this :
[edit 1 : in response to comment by 'NoBugz] In this case there is no ControlBox on the Form, and there is a reason for putting one level of indirection in what happens when the user chooses to close the Form [/e...
I have a code snippet that I want to run when the app is closing. So, I used FormCLosing event. But now i wanna place a confirmation message for exiting. Like, if the user clicks the Exit(X) button, there'll be a prompt, if he clicks NO, then the app will not close and revert to previous state.
Now I find that hard to achieve using For...
Hello!
I have a MDI main form. On it I host a form, and I want it to show a message box before it closes (asking the user whether to save changes).
So far so good, however I have discovered that closing the MDI main form does not raise a MDI child FormClosing event. I figured I will just call MdiChild.Close() in the MDI main's FormClos...
After I added the following code to my code-behind, my form doesn't get closed.
Could you please help me out with this one?
private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
MyThreadingObj.Dispose();
}
...