There are a couple of ways to do this. One is to have a bit of know-how with RTF(can be hard).
The other is (maybe only in .NET2.0 and later) to use the proeprties outlines for the RichTextBox.
.SelectionColor and .SelectionBackColor (among others)
You would set these to the colors you would want, append the username to the text, then change the colors back to the regular values (black text on white background for example)
As an example:
-
void AddMessage(string Username, string MsgText)
-
{
-
myRichTextBox.SelectionColor = Color.Red;
-
myRichTextBox.AppendText(Username);
-
myRichTextBox.SelectionColor = Color.Black;
-
myRichTextBox.AppendText(MsgText);
-
}
-