private void btnTest_Click(object sender, EventArgs e) { try { RegexTest rTest = new RegexTest(tbSearchFor.Text, tbReplaceWith.Text); rTest.Show(); } catch (Exception ex) { MessageBox.Show("There was an error running regex test. Please examine the error log.", "Failure", MessageBoxButtons.OK, MessageBoxIcon.Error); } }