private void buttonOK_Click(object sender, EventArgs e) { string res = Check(); if (res.Length > 0) { string acceptstr = "Click Retry to correct errors, Abort to cancel, Ignore to accept valid entries"; DialogResult dr = ExtendedControls.MessageBoxTheme.Show(this, "Filters produced the following warnings and errors" + Environment.NewLine + Environment.NewLine + res + Environment.NewLine + acceptstr, "Warning", MessageBoxButtons.AbortRetryIgnore); if (dr == DialogResult.Retry) { return; } else if (dr == DialogResult.Abort || dr == DialogResult.Cancel) { DialogResult = DialogResult.Cancel; Close(); } } actionfile.ChangeEventList(result); actionfile.WriteFile(); DialogResult = DialogResult.OK; Close(); }