I've a RichTextBox and I want color text in it. Is there any tag option? I'd like something like this [color:red]nick[/color] some message
. Because I need to save it as text and I want on reload have also colored text.
Can I do something like this without writing own method?
You can set color for text in RichTextBox with SelectionColor
And if you want to save your rtf as plain text, then you will have to look at rtf format. Example:
{\rtf1\ansi\deff0 {\colortbl;\red0\green0\blue0;\red255\green0\blue0;} This line is the default color\line \cf2 This line is red\line \cf1 This line is the default color }
EDIT:
From this example - first of all you have to declare color table \colortbl
in fololowing format:
{\colortbl; color1; color2; ... ; colorN;}
And then in the text you will have to enclose text with {\cfN YOUR_TEXT}
where N is a number of color from table; you can not specify the boundaries of the block {}, then everything after \ cfN will be one color.