M
michael sorens
The documentation for the RichTextBox is sketchy at best. I want to do a
very simple task but I cannot find information on this. I am using a
RichTextBox as an output window. Some text I want to just add plain (e.g..
rtf.Text += "new stuff..."; ) but some text, when added, I want to be in a
different color or font size. Find() will not work because the text will
vary. I have delimiters on it so I could recognize it with a regular
expression (e.g. "\[.*?\]") but Find only takes constant strings. The
issue, then, is being able to select by regular expression, after which I
could set the SelectionFont or SelectionColor. Also, I observe that whenI
add new text, previous formatting I have done disappears. So I have to
reapply all formatting each time I add something; is that the way it is
supposed to work?
very simple task but I cannot find information on this. I am using a
RichTextBox as an output window. Some text I want to just add plain (e.g..
rtf.Text += "new stuff..."; ) but some text, when added, I want to be in a
different color or font size. Find() will not work because the text will
vary. I have delimiters on it so I could recognize it with a regular
expression (e.g. "\[.*?\]") but Find only takes constant strings. The
issue, then, is being able to select by regular expression, after which I
could set the SelectionFont or SelectionColor. Also, I observe that whenI
add new text, previous formatting I have done disappears. So I have to
reapply all formatting each time I add something; is that the way it is
supposed to work?