for(int i=1;i<rtb.Lines.Length;i++)

{

if(rtb.Lines[i] == rtb.Lines[i - 1])

{

int bg = rtb.GetFirstCharIndexFromLine(i);//获得当前行起始位置

rtb.Select(bg, rtb.Lines[i].Length);

rtb.SelectionColor = Color.Red;

}

}

05-14 04:49