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;
}

Recommended Answers

All 2 Replies

Off the top of my head, I don't think there's a way to do that without some kind of presentation trick that hides the changes in progress until they're finished.

Thank you for that info, then I know.

Off the top of my head, I don't think there's a way to do that without some kind of presentation trick that hides the changes in progress until they're finished.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.