RichTextBox - how to disable AutoScroll on AppendText method

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Every time when I add text in my RichTextBox control via AppendText method -
the control
is autoscrolled to the end of text. I need avoid this effect. How can I do it?

Thanks in advance!

I'll very appreciate any ideas! :)
 
If you are having trouble with scrolling to the end of the text, you may try
something like:

int pos = richTextBox.SelectionStart;
richTextBox.AppendText(stuff);
richTextBox.SelectionStart=pos;
richTextBox.ScrollToCaret(); // try with and without this line

Note: when I just tried to append text to a RichTextBox, I did not see the
behavior that you mentioned. Are you calling ScrollToCaret() accidentally?
 
Back
Top