tags:

views:

15

answers:

1

I am dynamically adding text in a RichTextBox.

How can I set focus on the last line so the user can see it?

+1  A: 

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();
Ray Burns