I am dynamically adding text in a RichTextBox.
How can I set focus on the last line so the user can see it?
I am dynamically adding text in a RichTextBox.
How can I set focus on the last line so the user can see it?
This will move the caret to the last line:
richTextBox.CaretPosition = richTextBox.Document.ContentEnd;
But it will not scroll the richTextBox to make the caret visible. To accomplish that you also have to call ScrollToEnd():
richTextBox.CaretPosition = richTextBox.Document.ContentEnd;
richTextBox.ScrollToEnd();