tags:

views:

558

answers:

2

Probably not double buffering but I'm trying to make a highlighter (pure amusement) using a RichTextBox. The problem I have is that, when there are a lot of highlighted words, programmer-made flickering appear and even see the textbox scroll.

I don't think that RichTextBox has DoubleBuffered property, and even if it had, it wouldn't word, the flickering is my fault.

+1  A: 
int pos = myTextBox.SelectionStart;
RichTextBox buffer = new RichTextBox();
buffer.Rtf = myRichTextBox.Rtf;

//Do whatever you wanna do in buffer


myTextBox.Rtf = buffer.Rtf;
myTextBox.SelectionStart = pos;
myTextBox.SelectionLength = 0;

Tho, I still have a problem because, no matter what I do, myTextBox.ZoomFactor seems to be deleted.

Anzurio
A: 

Just use LockWindowUpdate on your RichTextBox before changing the color.

dfgdfgdfgdfgdfg