This question already has an answer here:
-
How do I automatically scroll to the bottom of a multiline text box?
11 answers
I'm updating my text box with text using a timer. Each time timer ticks I'm being redirected to the beginning to the text typed in my multiline text box.
How to do this?
I'd say that when you refresh, you could move the selection cursor to the end, then scroll the textbox 'til it's visible using ScrollToCaret.
That'll be something like
yourtextbox.SelectionStart = yourtextbox.Text.Length
yourtextbox.ScrollToCaret()
This works much better. It's better than Kotch's solution because there is no need constantly updating the position of cursor.
txtDisplay.AppendText(txtDisplay.SelectedText);
Try using the TextBox.Select
method:
textBox.Select(textBox.Text.Length, 0);
That will set the cursor to just past the last character in the text box.