C# scrolling of richtextbox

2019-08-07 05:09发布

问题:

Is there a method to scroll the richtextbox to the top automatically with codes? Thanks!

回答1:

you mean bottom?

instance.SelectionStart = instance.Text.Length;

or i guess top would be instance.SelectionStart = 0.



回答2:

Set .SelectionStart=0 and then .ScrollToCaret().



回答3:

richTextBox.SelectionStart = richTextBox.Text.Length;
richTextBox.ScrollToCaret();

tRY the above 2 lines of code it worked for me!