本文介绍了如何在富文本框中的文本光标之前获取字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我是C#编程的新手.
我在Richtextbox上遇到问题,我不知道如何在文本光标之前获取文本.我对此一无所知.所以请某人帮助我.
阅读感谢.
真诚的.
Hi everyone,
I am new in programming C#.
I am having a problem with richtextbox,I don''t know how to get the text before the text cursor. I have no idea about this. So plz someone help me.
Thx for reading.
sincerely.
推荐答案
If there is no selection, you get the current cursor position, and zero. The value is number of characters from the start of the text, so it is simple to work out what characters are before the cursor!<br />
如果没有选择,我将获得当前光标的位置,并且光标之前的字符为零,这不是I ??
我不明白.
先生,因为我的英语不好.
谢谢我.
真诚的.
If there is no selection, I will get the current cursor position, and characters before cursor is zero,won''t I??
I don''t understand.
Sr for my bad English.
Thx for relying me.
Sincerely.
这篇关于如何在富文本框中的文本光标之前获取字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!