如何将光标设置为richtextbox中的特殊位置 [英] how set cursor is special position in richtextbox

查看:92
本文介绍了如何将光标设置为richtextbox中的特殊位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有richtextbox,我想将光标移到richtextbox中的特殊位置.
怎么办?

例如我的rtb长度为20
我想将光标移到位置15

tnx

i have richtextbox and i want to move the cursor to special position in richtextbox
how do this??

for example my lenght of my rtb is 20
and i want to move cursor to position 15

tnx

推荐答案

设置RichTextBox.SelectionStart属性-输入指针(或插入符")将紧随其后:
Set the RichTextBox.SelectionStart property - the input pointer (or "caret") will follow it:
myRichTextBox.SelectionStart = characterNumberIWantTheCaretAt;


这篇关于如何将光标设置为richtextbox中的特殊位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆