WPF RichTextBox - ScrollToEnd() method does not cause any scrolling to occur

Kyle picture Kyle · Sep 11, 2009 · Viewed 9.5k times · Source

The RichTextBox component in my WPF app is populated using a FlowDocument and the RichTextBox's Document property.

rtb.ScrollToEnd(); doesn't seem to do anything, and i've even tried calling BringIntoView() on the last "row" added to the table that structures my FlowDocument.

Any Suggestions? Thanks!

Answer

Mike picture Mike · Jan 25, 2011

I spent forever trying to figure out what I did wrong. Make sure you have <RichTextBox ScrollViewer.VerticalScrollBarVisibility="Auto"> set or simply nothing will happen and you'll wonder why.