You should use this code for the event handler of the button:
private void button1_Click(object sender, EventArgs e)
{
string strTextToFind = TextBox1.Text;
string strTextToReplace = textBox2.Text;
richTextBox1.Text.Replace(strTextToFind, strTextToReplace);
}
Basically the String.Replace method searches for the string (strTextToFind) and when it finds it, it replaces it with another string (strTextToReplace).