David Basarab
David Basarab

Reputation: 73301

Are there any open-source free replacements for a richtextbox in WPF?

I have a requirement to create an application that will open up about 10 mb log files and highlight certain expressions.

I thought using WPF and richtextbox will work, but the richtextbox rending time is unacceptable.

Is there anything that has richtextbox like highlighting, but has better performance?

There any other way to accomplish this?

Upvotes: 1

Views: 931

Answers (4)

user2226109
user2226109

Reputation: 13

If I understand what you're saying, you want a syntax highlighting RTB control. My personal favorite is the AvalonEdit control, (Here's an article on codeproject about it: http://www.codeproject.com/Articles/42490/Using-AvalonEdit-WPF-Text-Editor) which can syntax highlight like the editor in Visial Studio. It even has autocomplete, which your end users will love.

If you want something else, there's also the ICSharp Code editor. (Here's another article on codeproject about it: http://www.codeproject.com/Articles/30936/Using-ICSharpCode-TextEditor) This one pretty much has the same features as AvalonEdit, and I like this one as well. I actually used ICSharp Code editor in an app I made, and was pretty satisfied with the features.

As far as I know, both of these controls are very efficient, and would be better than just a richtextbox.

Upvotes: 0

Ana Betts
Ana Betts

Reputation: 74654

How are you generating your Flowdocument - depending on what you are doing you may be able to speed it up. However, I too have run into these issues, especially because you have to generate the FlowDocument on the UI thread and if it takes too long you end up with a black screen.

Upvotes: 0

Rob Allen
Rob Allen

Reputation: 17709

If you do not need to allow the user to edit the logs you may be able to get away with using a TextBlock and wrap the sections to be highlighted in <Style> tags which accomplish the highlighting.

Upvotes: 1

bnbeckwith
bnbeckwith

Reputation: 1015

Scintilla http://www.scintilla.org/ is used as a box for editing code. It provides highlighting for many different code syntax. You may be able to use it and specify the portions you need highlighted.

Upvotes: 1

Related Questions