© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•16mo ago•
6 replies
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?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Wpf RichTextBox styling
C#CC# / help
3y ago
❔ edmx is very slow
C#CC# / help
3y ago
❔ Control initialisation is very slow
C#CC# / help
3y ago
❔ Extract RTF-String from RichTextBox in WPF
C#CC# / help
3y ago