在c#的richtextbox中,怎样实现点击一个按钮后选中特定的文字 在窗体的中点击button1,然后在richtextbox中的“百度”两个文字会变成选中状态,就像记事本中的查找功能一样,当你查找到“百度”这两个字后,“百度”两个字变成蓝色的。怎么实现? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 SelectionStart = index;SelectionLength = length;SelectionBackColor =Color.Blue;SelectionColor = Color.White自己研究出来了 richTextBox1.Text = "把百度找出来"; string str = "百度"; int idx = richTextBox1.Text.IndexOf(str); richTextBox1.Select(idx, str.Length); richTextBox1.SelectionColor = Color.Blue; C#中listView读取xml文件 邮件发送IsBodyHtml的问题 在线散分,马上结贴!如何引用一个外部dll文件? 两个listview模板类,另求动态模板postback后读取 不能获得datagrid中编辑后的数据???? 关于C#数据库问题!!!!!! 如何数据排序? 求助各路大侠,SQLServer用计算机名可连接上,用ip就连不上 wpf加载窗体时播放一段动画 如何保证 TreeView 在失去焦点的时候 选中的TreeNode仍为高亮? 如何知道线程的状态,例如运行中、结束了……。 Remoting释放内存,求救
SelectionLength = length;
SelectionBackColor =Color.Blue;
SelectionColor = Color.White
自己研究出来了
string str = "百度"; int idx = richTextBox1.Text.IndexOf(str);
richTextBox1.Select(idx, str.Length);
richTextBox1.SelectionColor = Color.Blue;