Set cursor in RichTextBox

后端 未结 3 954
别跟我提以往
别跟我提以往 2021-01-21 12:15

I\'ve got a simple form with RichTextBox on it. In Load event, I write some text to RichTextBox and now I want to set cursor location to the end of this text so I can add someth

3条回答
  •  感动是毒
    2021-01-21 12:48

    You can either use the CaretPosition property or use the Select(pos, pos) method to achieve the desired result.

    Edit:

    The Focus method just moves the keyboard focus to your RichTextBox, but it doesn't alter the current position of the cursor inside the control.

提交回复
热议问题