2015.11.3 RichBox改变若干文本颜色

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;

                }

            }

原文地址:https://www.cnblogs.com/mol1995/p/5964905.html