private void button1_Click(object sender, EventArgs e) { if (this.OnCancelClick()) { buttonCancel.Text = "Closing..."; buttonCancel.Enabled = false; if (Cancel != null) Cancel(); } }