How do I jump to a specific line in a RichTextBox?

南楼画角 提交于 2019-12-23 13:38:22

问题


I'm looking for an example code how to jump to a specific line of a RichTextBox in WPF.

I have no idea how to do this, in winForms it is very simple because I'm free to can set SelectionStart and SelectionLength that unlike in WPF the equivalent properties are read only.


回答1:


You have some options in the API:

  • LineDown
  • ScrollToVerticalOffset
  • ScrollToEnd


来源:https://stackoverflow.com/questions/9013029/how-do-i-jump-to-a-specific-line-in-a-richtextbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!