Selection.Attributes.Font.Color := clRed;
Selection.Attributes.Font.Size := 12;

解决方案 »

  1.   

    Selection.Attributes.Font.Color := clRed;
    Selection.Attributes.Font.Size := 12;
      

  2.   

    RichEdit1.SelAttributes.Color := clBlue;
      RichEdit1.SelAttributes.Style := [fsBold, fsItalic];
    RichEdit1.SelAttributes.Size:=12;
      

  3.   

    procedure TForm1.N12Click(Sender: TObject);// 局部字体设置的处理程序
    begin  
       if richedit1.SelLength>0 then
    begin
        fontdialog1.Font.Assign(richedit1.DefAttributes);
        if fontdialog1.Execute then
        richedit1.SelAttributes.Assign(fontdialog1.Font);
    end;
    end;