//RichText添加选区 颜色
private void ChangeColor(string text, Color color)
{
//int s = 0;
//while ((-1 + text.Length - 1) != (s = text.Length - 1 + this.txtResult.Find(text, s, -1, RichTextBoxFinds.MatchCase | RichTextBoxFinds.WholeWord)))
//{
// this.txtResult.SelectionColor = color;
//}
int s = 0;
//并上 RichTextBoxFinds.WholeWord 就没结果
while (this.txtResult.Find(text, s, RichTextBoxFinds.MatchCase) > -1)
{
s = this.txtResult.Find(text, s, RichTextBoxFinds.MatchCase);
this.txtResult.Select(s, text.Length);
this.txtResult.SelectionColor = color;
s++;
}
}