RichTextBox.SelectionColor 怎样控制文本的颜色?
我想让其中的几行(含有“我们”)字符的行颜色变为蓝色,其余行保持黑色,怎么写?
this.richTextBox1 .SelectionStart =“我们”当前索引;
this.richTextBox1 .SelectionLength =“我们”行的长度;
richTextBox1.SelectionColor = System.Drawing.Color.Blue;
//其它行恢复为黑色
this.richTextBox1 .SelectionLength =0;
richTextBox1.SelectionColor = System.Drawing.Color.Black ;
可是在打开新文件时,都变成红色,在哪控制?