title: RichTextBox scroll to end
body: <p>I have a RichTextBox which I want to automatically scroll to the end of the text, when new text gets added.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>private void outputWindowTextChanged(object sender, EventArgs e) {
      rtb_outputWindow.SelectionStart = rtb_outputWindow.Text.Length;
      rtb_outputWindow.ScrollToCaret();
  }
  </code></pre>
  
  <p>I manually add a bunch of text to the RichTextBox, like so:</p>
  
  <pre><code>updateOutputWindow("Lorem ipsum dolor sit amet, ..."); //These strings are really long
  updateOutputWindow("Lorem ipsum dolor sit amet, ..."); //I shortened them for this question
  </code></pre>
  
  <p>Here is the result:</p>
  
  <p><a href="https://i.stack.imgur.com/kXbhd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kXbhd.png" alt="screenshot1"></a></p>
  
  <p>In the above screenshot you can just barely make out that there is actually more text underneath the edge. You can also look at the scroll bar on the right, and see that there's a little bit of space left underneath.</p>
  
  <p><a href="https://i.stack.imgur.com/4DAwv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4DAwv.png" alt="screenshot2"></a></p>
  
  <p>In the above screenshot I manually scrolled down to the bottom, using the scroll bar on the right; revealing the before hidden text.</p>
  
  <p>Is there a way to make sure that the RichTextBox automatically gets scrolled to the very end, every time?</p>