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;

                }

            }

posted on 2016-10-15 17:33  mol1995  阅读(222)  评论(0编辑  收藏  举报

导航