WPF RichTextBox性能 [英] WPF RichTextBox Performance
问题描述
当加载50KB文本文档时,WPF的RichTextBox控件的性能确实很慢。滚动慢速并按Ctrl-A选择所有文本需要10秒钟以上。 (这在记事本上是不经意的。)
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).
我没有做任何奇特的位图效果。这正常吗?甚至在一个空的RichTextBox上键入内容似乎也比正常情况有些滞后。
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!
推荐答案
您可能需要考虑使用其他文本框控件。
You might need to consider using a different text box control.
Daniel Grunwald完全从零开始为SharpDevelop编写了Wpf文本编辑器。它称为AvalonEdit,并且在codeproject上有一篇不错的文章:
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
看来他已经为大文件。
这篇关于WPF RichTextBox性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!