C # - displaying large amounts of text in WinForm

I want to be able to display process update information for the user. The way I want to do this is to control the main winform, which (in an still uncertain process) informs the user through the text about the status. I want this text to scroll (inside the control) when adding more text.

What is the best way to achieve this?

+4
source share
2 answers

Use multi-line TextBox, for example:

myTextBox.Multiline = true; 

And update it while scrolling down, for example:

 myTextBox.Text += "My message" + System.Environment.NewLine; myTextBox.SelectionStart = myTextBox.Text.Length; myTextBox.ScrollToCaret(); 
+5
source

Well, a multi-line TextBox or RichTextBox will do the job perfectly. Use its AppendText () method.

I can not judge the value of this information from your question. In general, avoid assuming that the user is interested in implementation details, especially when there are many. ProgressBar is almost always the most appropriate indicator of progress. Maybe a shortcut or StatusStrip to give some context.

Beware of the cost of Control.BeginInvoke () for updating controls.

+3
source

All Articles