Change color of text within a WinForms RichTextBox

Posted by Addie on Stack Overflow See other posts from Stack Overflow or by Addie
Published on 2010-03-27T00:42:35Z Indexed on 2010/03/27 1:23 UTC
Read the original article Hit count: 501

Filed under:
|
|

I have a RichTextBox that I write a string to every time I click a Form button. The string ends with a newline so each time I add a string, it appends to the bottom of the RichTextBox. Each string begins with the string "Long" or "Short" and ends with Environment.NewLine. I'd like to color each line red if it beings with "Long" and blue if it begins with "Short". How can I do this? If you need further clarification of the question comment below.

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms