How to constantly scroll to the end of the text in a multi-line text box?

I am updating my text box with text using a timer. Every time the timer ticks, they redirect me to the beginning of the text typed in a multi-line text box.

How to do it?

+7
source share
3 answers

I would say that when updating you can move the selection cursor to the end, then scroll the text box until it is visible with ScrollToCaret.

It will be something like

yourtextbox.SelectionStart = yourtextbox.Text.Length yourtextbox.ScrollToCaret() 
+10
source

It works a lot better. This is better than the Kotch solution because there is no need to constantly update the cursor position.

 txtDisplay.AppendText(txtDisplay.SelectedText); 
+11
source

Try using the TextBox.Select method:

 textBox.Select(textBox.Text.Length, 0); 

This will cause the cursor to move through the last character in the text box.

+2
source

All Articles