Search code examples
.netwpfscroll

How to make WPF TextBox with a scrollbar automatically scroll to the bottom when lines are added?


For example like Visual Studio's "Output" window does.

Is there a way to do it in XAML?


Solution

  • You can handle the TextChanged event, which will fire whenever you change that TextBox's Text: TextBoxBase.ScrollToEnd().