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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top