title: Search And Highlight Multiple Text
body: <p>Here is the code I have, It works great, but what I need it to do is search for more than one word and highlight all the words from the list I give it.</p>
  
  <p>So lets say I have it search "Close" and it highlights all the words containing that Red. Well how do I make it so it will highlight more words other than just "Close". So have it simultaneously search multiple text such as "Close" &amp;&amp; "Enter" &amp;&amp; "Leave"</p>
  
  <hr>
  
  <pre><code>private void btn_Search_Click(object sender, EventArgs e)
  {
      try
      {
          if (richTextBox1.Text != string.Empty)
          {
              // if the ritchtextbox is not empty; highlight the search criteria
              int index = 0;
              String temp = richTextBox1.Text;
              richTextBox1.Text = "";
              richTextBox1.Text = temp;
              while (index &lt; richTextBox1.Text.LastIndexOf("Close"))
              {
                  richTextBox1.Find("Close", index, richTextBox1.TextLength, RichTextBoxFinds.None);
                  richTextBox1.SelectionColor = Color.Cyan;
                  index = richTextBox1.Text.IndexOf("Close", index) + 1;
                  richTextBox1.Select();
              }
          }
      }
  }
  </code></pre>