用这个方法,iCodeRowsID是要跳转的行号,rtb是RiCHTextBox控件名。

其中rtb.Lines.Length可获得最大行数

1   private void TrunRowsId(int iCodeRowsID,RichTextBox rtb)
2         {
3             rtb.SelectionStart = rtb.GetFirstCharIndexFromLine(iCodeRowsID);
4             rtb.SelectionLength = 0;
5             rtb.Focus();
6             rtb.ScrollToCaret();
7         }

 

相关文章:

  • 2021-12-06
  • 2022-02-27
  • 2021-09-13
  • 2021-12-12
  • 2022-01-05
  • 2022-02-20
  • 2021-08-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2021-12-20
  • 2022-01-21
  • 2022-02-03
  • 2021-12-06
相关资源
相似解决方案