this.richTextBox1.Select(1,5);
this.richTextBox1.SelectionColor=Color.Red;将1到5个字符改为红色

解决方案 »

  1.   

    private void ToggleBold()
    {
       if (richTextBox1.SelectionFont != null)
       {
          System.Drawing.Font currentFont = richTextBox1.SelectionFont;
          System.Drawing.FontStyle newFontStyle;      if (richTextBox1.SelectionFont.Bold == true)
          {
             newFontStyle = FontStyle.Regular;
          }
          else
          {
             newFontStyle = FontStyle.Bold;
          }      richTextBox1.SelectionFont = new Font(
             currentFont.FontFamily, 
             currentFont.Size, 
             newFontStyle
          );
       }
    }修改字体