Font myFont=new Font("Ariel",richTextBox1.SelectionFont.Size,richTextBox1.SelectionFont.Style|FontStyle.Bold);
richTextBox1.SelectionFont=myFont;

解决方案 »

  1.   

    不好意思,会错意。thinking........
      

  2.   

    比较笨的办法。。遍厉选中的字体,一个个加粗
    int l = richTextBox1.SelectionLength;
    if (l > 0)
    {
    for(int i=richTextBox1.SelectionStart;i<l;i++)
    {
    richTextBox1.SelectionStart = i;
    richTextBox1.SelectionLength = i+1;
    if (richTextBox1.SelectionFont != null)
    {
    Font myFont=new Font(richTextBox1.SelectionFont.FontFamily, richTextBox1.SelectionFont.Size,FontStyle.Bold);
    richTextBox1.SelectionFont=myFont;
    }
    }
    }
      

  3.   

    不好意思,上面那个有问题int l = richTextBox1.SelectionLength;
    int s = richTextBox1.SelectionStart;
    if (l > 0)
    {
    for(int i=s;i<s+l;i++)
    {
    richTextBox1.Select(i,1);
    if (richTextBox1.SelectionFont != null)
    {
    Font myFont=new Font(richTextBox1.SelectionFont.FontFamily, richTextBox1.SelectionFont.Size,FontStyle.Bold);
    richTextBox1.SelectionFont=myFont;
    }
    }
    }