RV
WPF RichTextBox is very slow
I want to make a syntax highlighter with WPF. I chose to use RichTextBox but when trying to paste about 50,000 lines into WPF richtextbox, it takes about 10 minutes to complete as in this video. I compared with textbox on winform and wpf, and compared richtextbox on winform is faster.
I also did syntax highlighter with update onscroll (not in rich text box) as at the end of the video and it can display faster. But when scrolling, over time the grid becomes have many objects (TextBlock) and becomes slow.
How can I do syntax highlighter in WPF efficiently and quickly?
7 replies