private void replaceAllButton_Click(object sender, EventArgs e) { while (ExecFind()) { if (_textBox.SelectionLength > 0) _textBox.SelectedText = ReplaceTextBox.Text; }; }