无论如何,我可以提高(wpf)richtextbox 的性能吗?
我正在编写一个文本编辑器,现在如果我打字速度很快或按住某个键,打字就会变得非常缓慢。我之前正在开发这个程序的 winforms 版本,并且没有任何延迟。我是否可以创建一个自定义的富文本框控件并删除所有不需要的属性?解决我的问题的最佳方法是什么?
I am writing a text editor and right now if I type very quickly or hold down a key the typing gets very laggy. I was previously working on a winforms version of this program and there was no lag. Would it be possible for me to create a custom richtextbox control and strip out all of the unneeded properties? What would be the best way to fix my problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 AvalonEdit 开源语法高亮文本编辑器用于 SharpDevelop。它可能会给你一些想法。我还期待 .NET 4,它已经投入了大量时间,以实现 Visual Studio 所需的巨大性能提升(它几乎在整个 shell 中使用 WPF)。
特别是,在 .NET 3.5 中,控件做了很多工作不必要的重新粉刷。查看 这篇关于 WPF 性能技巧的博客文章。
Check out the AvalonEdit open source syntax-highlighting text editor that is used in SharpDevelop. It may give you some ideas. I would also look towards .NET 4 which has been worked over big time in order to achieve big performance gains needed by Visual Studio (which uses WPF for nearly the entire shell.)
In particular, in .NET 3.5, controls did a lot of unnecessary repainting. Check out this blog post about WPF performance tips.