UWP/C# 如何将文本从文本框滚动到选定的文本?
我有一个具有文本转语音功能的 UWP 桌面应用程序。其中,我有一个文本框来包含将由语音合成器执行的文本。在执行期间,应用程序选择当前执行的短语。但是,由于文本比文本框大,我需要滚动文本,以便用户可以看到执行和选择的短语。如何做到这一点?非常欢迎任何帮助。
I have a UWP Desktop application with Text to Speech capabilities. In it, I have a TextBox to contain the text that will be executed by the Speech Synthesizer. During execution, the application selects the currently executed phrase. However, since the text is larger than the TextBox, I need to scroll the text so that the executed and selected phrase is visible to the user. How to do this? Any help is most welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
恐怕您无法滚动到 UWP TextBox 中的特定位置。它看起来不包含
ScrollTo
方法。但是,您可以获取 TextBox 的内部ScrollViewer
然后调用ChangeView
方法滚动到您想要的位置。例如。
I'm afraid you can't scroll to specific position wihtin UWP TextBox. It looks does not contains
ScrollTo
method. However, you could get TextBox's internalScrollViewer
then callChangeView
method to scroll to your wanted position.For example.