private void OnTaskDialogFormClosing(object sender, FormClosingEventArgs e)
{
// If the dialog is being closed because of a user event then it would be either
// Alt+F4, Hit the close chrome button or the Close common dialog button
if (e.CloseReason == CloseReason.UserClosing)
DialogResult = DialogResult.Cancel;
}