Anthony Brien
Anthony Brien

Reputation: 6166

Recommendations for making a Log Window in WPF

I'm currently working on a Log Window for my application that looks and behaves just like the Output Window in Visual Studio. It can be bombarded by thousands of messages per second, and it needs to handle a very large log (hundreds of thousands of lines).

So far, I've made one quickly by using a RichTextBox and it works well. I used the RichTextBox instead of a TextBox because I thought it might be nice to eventually format error messages with a color.

Is the RichTextBox a good choice or are there better alternatives? And is there any other recommendations to follow to make it as efficient as possible?

Upvotes: 5

Views: 1246

Answers (1)

Preet Sangha
Preet Sangha

Reputation: 65496

Queue the messages and let a background thread format them. I'd also suggest making the the window a view on a section of the queue so that the window doesn't have to fill up.

Upvotes: 2

Related Questions