Multiline Textbox with automatic vertical scroll

后端 未结 4 1412
清酒与你
清酒与你 2020-12-14 05:37

There are a lot of similiar questions over internet, on SO included, but proposed solutions doesn\'t work in my case. Scenario : there is a log textbox in xaml



        
4条回答
  •  抹茶落季
    2020-12-14 06:32

    According to this question: TextBox.ScrollToEnd doesn't work when the TextBox is in a non-active tab

    You have to focus the text box, update the caret position and then scroll to end:

    Status.Focus();
    Status.CaretIndex = Status.Text.Length;
    Status.ScrollToEnd();
    

    EDIT

    Example TextBox:

    
    

提交回复
热议问题