Recently I was working with Windows form and wanted the
scroll of the rich textbox to be on the last line when there was some text
changed. I am very new to windows form (having worked mainly in web forms [Asp.Net]).
Then I saw this property of the textbox called ScrollToCaret. So what I did was made the selection start at the
end of the textbox and scroll the caret there.
this.txtMessages.SelectionLength = 0;
this.txtMessages.SelectionStart = this.txtMessages.Text.Length;
this.txtMessages.ScrollToCaret();
What I do here is unselect the richtextbox and then start
the selection at the end of the textbox and scroll the caret there.
Thanks
Vikram
P.S. Used the above code in the TextChanged event of
the Rich Textbox