How to keep the scroll always at the end of the WPF textbox

0

How can I keep scrolling at the end of the textbox? I have a textbox, but it receives a lot of content, and when it arrives at the end it does not follow and text that exceeds, stays in the same place.

    
asked by anonymous 29.05.2016 / 18:26

1 answer

1

I found this solution here

textBox.VisibleChanged += (sender, e) =>
{
    if (textBox.Visible)
    {
        textBox.SelectionStart = textBox.TextLength;
        textBox.ScrollToCaret();
    }
};

Sources: link

    
30.05.2016 / 15:36