Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best approach to Windows Forms rolling log output in TextBox

In a Forms application I'm displaying log output from a long running command-line application that generated a lot of output. I start the program in the background, and capture its output and currently display it in a TextBox using AppendText. I prefer to only display for example the last 1000 lines. Removing lines from a TextBox is expensive, and a TextBox does not really feels like the best approach for rolling log display.

Any ideas on the best Control to do a rolling log window in Windows Forms?

like image 284
Serge van den Oever Avatar asked Dec 20 '08 22:12

Serge van den Oever


1 Answers

I used to have listboxes do this kind of thing. You just remove the first line if the line count reaches, say, 1000. If the log line is too long, you could make the listbox a bit wider (depends on the log information and whether it's possible to catch the meaning from the first visible words without horizontal scrolling) and make the horizonal scrollbar visible.

like image 164
liggett78 Avatar answered Oct 06 '22 08:10

liggett78