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

后端 未结 4 873
时光说笑
时光说笑 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:52

    You could write an attached property or even better a behavior that listens to the TextChanged event and scrolls to the bottom in the callback.

提交回复
热议问题