目标:传入目标富文本框以及需要查找的字符串,如果文本框中存在字符串,则改变其颜色和字体 可能因为这个问题比较简单,在网上找了很久,也没有一个好的方法.少有的一些方法,也只是改变第一个找到的字符串的颜色和字体. 网上找不到现成的答案只好去翻微软的开发文档,最好,找到的RichTextBox的这么一个方法: public int Find( string str, int start, RichTextBoxFinds options ) 官方介绍是:在对搜索应用特定选项的情况下,在 RichTex
private void HilightRichText(RichTextBox control, string hilightString) { int nSelectStart = control.SelectionStart; int nSelectLength = control.SelectionLength; int nIndex = 0; while (nIndex < con
要自当前光标位置向上搜索,请使用以下命令: /pattern Enter 其中,pattern 表示要搜索的特定字符序列. 要自当前光标位置向下搜索,请使用以下命令: ?pattern Enter 按下 Enter 键后,vi 将搜索指定的 pattern,并将光标定位在 pattern 的第一个字符处.例如,要向上搜索 place 一词,请键入: