views:

358

answers:

1

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?

+1  A: 

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.

Preet Sangha