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

后端 未结 4 870
时光说笑
时光说笑 2020-12-15 16:23

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

Is there a way to do it in XAML?

4条回答
  •  再見小時候
    2020-12-15 16:36

    You can whenever you add content to that TextBox or when you listen to the event TextChanged fire this method: TextBoxBase.ScrollToEnd().

提交回复
热议问题