0

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;
}
2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Jennifer84
0

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.

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.