views:

618

answers:

1

WPF's RichTextBox control's performance is real slow when a 50KB text document is loaded. Scrolling laggy and pressing Ctrl-A to select all the text takes more than 10 seconds. (This is intantaneous on Notepad).

I'm not doing any fancy bitmap effects. Is this normal? Even typing on an empty RichTextBox seems a bit laggy than normal.

Are there fixes for this? Alternatives? Thanks!

+2  A: 

You might need to consider using a different text box control.

Daniel Grunwald has written the Wpf text editor for SharpDevelop completely from scratch. It is called AvalonEdit and a good article is on codeproject:

http://www.codeproject.com/KB/edit/AvalonEdit.aspx

It seems that he has done optimizations for large files.

Patrick Klug
I have added a wish for a better RichTextBox editor here - go and suppor it: http://dotnet.uservoice.com/forums/40583-wpf-feature-suggestions/suggestions/995859-completely-rework-the-richtextbox-control-make-it
Patrick Klug