Michał Peterek
Michał Peterek

Reputation: 11

UWP : Scroll to end of RichEditBox without focus

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.

Upvotes: 0

Views: 141

Answers (1)

Nico Zhu
Nico Zhu

Reputation: 32785

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);
}

Upvotes: 1

Related Questions