barrytraver
Programmer
I'm trying to figure out how to modify rich text in a rich textbox in code.
Perhaps an example is the best way to show what I do and don't know how to do.
Let's suppose I have the plain text "one two three " in a Rich Textbox.
I know how to take the word "three" and change the color to vbRed and the font style to bold. (It's simply a matter of setting Text1.SelStart, Text1.SelLength, Text1.SelColor nd Text1.SelBold.) So far, so good.
What I don't know how to do is add a word at the end without losing the RTF information in the presently-existing string.
That is, I can add "four " to the end so that the text in the text box says "one two three four ", but when I do that, the red and bold characteristics of the word "three" disappear. The whole string is now normal black type (no red, no bold). <sigh>
Any help on this would be greatly appreciated. Thanks in advance.
Barry Traver
Perhaps an example is the best way to show what I do and don't know how to do.
Let's suppose I have the plain text "one two three " in a Rich Textbox.
I know how to take the word "three" and change the color to vbRed and the font style to bold. (It's simply a matter of setting Text1.SelStart, Text1.SelLength, Text1.SelColor nd Text1.SelBold.) So far, so good.
What I don't know how to do is add a word at the end without losing the RTF information in the presently-existing string.
That is, I can add "four " to the end so that the text in the text box says "one two three four ", but when I do that, the red and bold characteristics of the word "three" disappear. The whole string is now normal black type (no red, no bold). <sigh>
Any help on this would be greatly appreciated. Thanks in advance.
Barry Traver