Appending text to a RichTextBox control
Posted on 2003-03-10
I'm trying to use a RichTextBox to log the results of a database maintenance tool. What I am looking for is a function that will append text to the end of the control that can make the text a given color, bold, italic, etc... For instance I would like to have the category headings in bold and any errors logged in red as the tool is running.
I've tried using rtb.Text = rtb.Text & newString, and then selecting and formating the new string, but this will wipe out the previous formatting.
I've been moderately successful using the TextRTF property to make the text bold, but I haven't been able to get it to display the text in different colors.