public static void performQuestionYesNoCancel(Form form, string question) { DialogResult result = MessageBoxUtils.showQuestionYesNoCancel(question); if (result == DialogResult.Yes) { form.DialogResult = DialogResult.OK; form.Close(); } else if (result == DialogResult.No) { form.DialogResult = DialogResult.Cancel; form.Close(); } }