[C#]
public Color SelectionColor {get; set;}
 设置这个属性。

解决方案 »

  1.   

    这么简单的问题,我贴段代码,其中rtbReceive是一个RichTextBox控件
    int iPos=rtbReceive.TextLength;
    rtbReceive.AppendText(str1);
    rtbReceive.Select(iPos,rtbReceive.TextLength-iPos);
    rtbReceive.SelectionFont = new Font("宋体", 9, FontStyle.Bold | FontStyle.Underline);
    rtbReceive.SelectionColor = System.Drawing.Color.Red;iPos=rtbReceive.TextLength;
    rtbReceive.AppendText(str2);
    rtbReceive.Select(iPos,rtbReceive.TextLength-iPos);
    rtbReceive.SelectionFont = new Font("宋体", 12, FontStyle.Regular);
    rtbReceive.SelectionColor = System.Drawing.Color.Red;
    rtbReceive.SelectionIndent=20;