简体   繁体   English

如何在Windows Phone 8中以编程方式滚动RichTextBox

[英]How to scroll a richtextbox programmatically in windows phone 8

I'm creating an app for windows phone using a richtextbox from ComponentOne . 我正在使用ComponentOne中richtextbox创建Windows Phone应用程序。

Whenever I press a button the richtextbox text changes, what I want to achieve is to scroll to the the bottom of that richtextbox by pressing that button. 每当我按下按钮时,richtextbox文本就会更改,我想要实现的是通过按下该按钮滚动到该richtextbox的底部。 And by pressing another button I want to scroll the top of that richtextbox. 通过按下另一个按钮,我想滚动显示该富文本框的顶部。

To scroll to the bottom: 滚动到底部:

rtb.ScrollTo(rtb.Document.ContentEnd);

To scroll to the top: 滚动到顶部:

rtb.ScrollTo(rtb.Document.ContentStart);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM