UWP : Scroll to end of RichEditBox without focus

135 views Asked by At

I'm writing a UWP app with console like text area. How can I scroll to end without using Focus. Focus is unusefull in my case becouse my app have a more then one text input. While writing to one of inputs, async changed data in RichEditBox and seted programaticaly Focus makes it impossible becouse carret is moving to richeditbox.

1

There are 1 answers

0
Nico Zhu On

Scroll to end of RichEditBox without focus

You could use ScrollIntoView method scroll to end without focus for RichEditBox. For more detail please refer the following code.

private async void bookmarkBtn_Click(object sender, RoutedEventArgs e)
{
    string tmp = string.Empty;
    REB.Document.GetText(TextGetOptions.None, out tmp);
    REB.Document.GetRange(0, tmp.Length).ScrollIntoView(PointOptions.None);
}