I have a wondering. I have put this code in the richTextBox1 event handler.
What happens is when you have written 11 characters, the 10 previous characters turns blue.
What I wonder is that this code selects and deselects these characters wich can result of "blinking" in the textbox sometimes as it selects/deselects so fast.
Is it possible to do this in any other way, that instead of select character 0 - 10, just to tell that character 0 - 10 will turn blue ?
int cursorpos = 0;
cursorpos = richTextBox1->SelectionStart;
if (cursorpos > 10)
{
this->richTextBox1->Select( 0, 10);
this->richTextBox1->SelectionColor = Color::Blue;
this->richTextBox1->DeselectAll();
this->richTextBox1->SelectionStart = cursorpos;
}