private void ApplyTextSize(string textSize)
    {
      // Convert the text to a float because we'll be needing a float shortly
      float newSize = Convert.ToSingle(textSize);
      FontFamily currentFontFamily;
      Font newFont;      // Create a new font of the same family but with the new size
      currentFontFamily = this.richTextBoxText.SelectionFont.FontFamily;
      newFont = new Font(currentFontFamily, newSize);
看msdn上SelectionFont 是个属性,返回的是font ,
font和fontfamily是什么关系

解决方案 »

  1.   

    fontfamily 就是像是word中的字体,font是fontfamily +大小+修饰
    例如:
    下面的示例构造一个字号为 16 像素、常规字形的 Arial 字体。在下面的代码中,传递给 Font 构造函数的第一个参数是 FontFamily 对象。第二个参数指定字体的大小,其单位由第四个参数确定。第三个参数确定字形。Pixel 为 GraphicsUnit 枚举的一个成员,Regular 是 FontStyle 枚举的一个成员。FontFamily fontFamily = new FontFamily("Arial");
    Font font = new Font(
           fontFamily,
           16,
           FontStyle.Regular,
           GraphicsUnit.Pixel);FontFamily 对象指定字样(例如 Arial),而 Font 对象指定字号、字形和单位。