private void buttonDelete_Click(object sender, EventArgs e) { if (IsNew) { DialogResult = DialogResult.Cancel; return; } if (!MsgBox.Show(this, MsgBoxButtons.OKCancel, "Delete?")) { return; } try { ICD9s.Delete(Icd9Cur.ICD9Num); DialogResult = DialogResult.OK; } catch (ApplicationException ex) { MessageBox.Show(ex.Message); } }