RichTextBox RTF issue
<p>I have a RichTextBox in Win form application with formating facilities like bold, italics, alignment etc options, right clicking on RTB opens ContexttoolStripmenu with option of inserting Client Address from database, which inserts a string <code>"$[ClientAddress]"</code> in the RTB text. When the save button is clicked <code>$[ClientAddress]</code> is replaced with actual address from database (which is in rtf format as under:</p>

<pre><code>string rtfText = richTextBox.Rtf;
rtfText = rtfText.Replace("$[ClientAddress]", $address);
</code></pre>

<p>The problem here is that all formationg/styling done on "$[ClientAddress]" in the rich text box is lost when it is replaced by actual address string (in rtf format) from database. </p>

<p>How can we pass the styling(formating) carried on $[ClientAddress] to the text that replaces $[ClientAddress]. </p>

<p>If address is passed as plain Text instead of rtf text from database then the formating stays but the line breaks between different lines of address are lost and address is printed in one straight line like: </p>

<pre><code>39 East Tamaki Road, Papatoetoe, Auckland, New Zealand instead of the correct way as below as originally entered :
39 East Tamaki Road
Papatoetoe
Auckland
New Zealand
</code></pre>

<p>I hope I have been able to make my problem clear.</p>