richTextBox and rtf problem
-
Hello all, I'm having some trouble with richTextBox. Using c# in Visual Studio 05. What I do first is to copy the control code ({\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard) in a string, and then the text I need from an rtf file (\f0This is some {\b bold} text.\par) in another string and combine them, I do this for loading specific lines of the file... Anyway, the problem is that when I load this in a richTextBox (rtb.Rtf = myString;), I noticed that the control code is changed. For example if the control code cotains code for 5 fontsyles in its fontable ({\f0\fnil\fcharset161 Microsoft Sans Serif;}{\f1\fnil\fcharset0 Tahoma;}{\f2\fnil\fcharset0 Arial;}{\f3\fnil\fcharset0 Arial Black;}{\f4\fnil\fcharset0 Arial Narrow;}), if the text uses only 3 of them the rest two are not included in the control code of the richTextBox ({\f0\fnil\fcharset0 Tahoma;}{\f1\fnil\fcharset0 Arial Black;}{\f2\fnil\fcharset0 Arial Narrow;}). I hope you understand what my problem is. Is there a way of avoiding this to happen, or, if not, how can I control this so when I need to make some changes in the fontstyle of the text, the file will be updated with no mistakes (like f1 is "Tahoma" and not "Arial Black")?