Quote Originally Posted by Arjay View Post
Just add a Cancel button to the progress dialog.
It already has one.

If the user presses the cancel button or the close 'X' button, ask the user of they wish to cancel the operation.
Nice idea, but I think I'll only implement that confirmation for the X button. Asking that after the user pressed the explicitly labeled Cancel button too much looks like some "Are you really sure?" kinda question to me.

I'm afraid there is no variant of the standard message box with a Cancel and a Continue button. Using the Ok/Cancel variant and giving the Cancel button the meaning cancel the cancellation might be puzzling too. I think I'll settle for the Yes/No variant, that's pretty neutral.

If the operation is such that once started it can't be cancelled, then don't show a cancel button and disable the 'X' button.
The operation can be cancelled eaisly, that's no problem.

Disabling the X button exactly was the problem I had with the variant of the progress dialog that didn't support cancellation: I couldn't find a way to do that. That's why Alex F suggested aborting the closing process in the FormClosing() handler.