title: How to selectively underline strings in RichTextBox?
body: <p>In my program after clicking on the button - selected ListView entries should be copied to  RichTextBox. ListView contains contact information, and the effect I want to accomplish is similar to the one in Oultook (when choosing contacts from contact book). Part of my code that serves this purpose looks like that:</p>
  
  <pre><code>    private void toButton_Click(object sender, EventArgs e)
      {
          int start = 0;
          for (int i = 0; i &lt; contactsListView.SelectedItems.Count; i++)
          {
              if (contactsTextBox.TextLength != 0) contactsTextBox.Text += "; ";
              start = contactsTextBox.TextLength;
              contactsTextBox.Text += contactsListView.SelectedItems[i].Text + " " + contactsListView.SelectedItems[i].SubItems[1].Text + " [" + contactsListView.SelectedItems[i].SubItems[2].Text + "]";
              contactsTextBox.Select(start, contactsTextBox.TextLength);       
              contactsTextBox.SelectionFont = new Font(contactsTextBox.SelectionFont, FontStyle.Underline);
              contactsTextBox.DeselectAll();
              contactsTextBox.SelectionFont = new Font(contactsTextBox.SelectionFont, FontStyle.Regular);
          }
      }
  </code></pre>
  
  <p>Unfortunately somehow FontStyle is inherited by entire text and everything I enter after entry from ListView is also underlined.</p>
  
  <p>So my question is - how to underline only certain text (where I have made a mistake)?</p>
  
  <p>There is similar topic on stackoverflow <a href="https://stackoverflow.com/questions/136132/better-way-of-manipulating-richtext-in-c">here</a> unfortunately in my case solution stated there will be waste of resources.</p>