using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NotePad
{
    public partial class frmReplace : Form
    {
        public frmReplace()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            (Application.OpenForms["Form1"].Controls["richTextBox1"] as RichTextBox).Text = (Application.OpenForms["Form1"].Controls["richTextBox1"] as RichTextBox).Text.Replace(txtFind.Text, txtReplace.Text);
        }
    }
}
