如何在richtextbox中找到一个单词

如何在richtextbox中找到一个单词

问题描述:

我有一个富文本框,一个文本框和一个按钮,假设文本框中有单词,而富文本框中有5个句子(一行中有一个句子)
当我单击按钮时,我想要在富文本框中的第一个句子中有多少个单词,然后搜索单词"highlight",然后光标移到下一行以找到单词.

预先感谢.

Hi i have one rich text box, one text box and one button, suppose there is word in text box and in rich text box there are 5 sentences (one sentence in a one line)
when i click on button so i want how many words are in rich text box first sentences and search word "highlight" and than cursor goes go next line to find the word.

Thanks in advance.

highlight: JavaScript text higlighting jQuery plugin

This might help you..


要突出显示单词,请使用SelectionStart和SelectionEnd属性选择单词.
要更改字体,请使用SelectionFont属性
To Highlight a word use SelectionStart and SelectionEnd Property to select the word.
To change the font use SelectionFont Property