if (DialogResult.Yes == result) { e.Cancel = false; // Cancel属性如果为true,表示取消该事件的执行。 } else { e.Cancel = true; } }