private void btnEditReplace_Click(object sender, EventArgs e) { FormReplace dlg = new FormReplace(); DialogResult result = dlg.ShowDialog(); if (result == DialogResult.Cancel) { return; } tbMemo.Text = tbMemo.Text.Replace(dlg.before, dlg.after); tbMemo.ScrollToCaret(); }
private void mnuEditReplace_Click(object sender, EventArgs e) { FormReplace dlg = new FormReplace(); DialogResult ret = dlg.ShowDialog(); if (ret == DialogResult.OK) // 착한 사용자인 경우 { strOrigin = dlg.sOrigin; strDest = dlg.sDest; tbMemo.Text = tbMemo.Text.Replace(strOrigin, strDest); Search_Scroll(strDest); strSearch = strDest; } }