请问在delphi中怎样打印立方厘米?要求不能是中文,必须是字母‘cm’加3上标的形式。

解决方案 »

  1.   

    richedit中应该可以显示这样的效果,不知打印如何?不过一般的报表控件好像都支持richedit的
      

  2.   

    procedure TForm2.QuickRep1BeforePrint(Sender: TCustomQuickRep;
      var PrintReport: Boolean);
    var QRlabelTemp:TQRLabel;
    begin
    QRlabel1.Caption:='CM'; QRlabelTemp:=TQRLabel.Create(self);
    with QRlabelTemp do
    begin
     Caption:='3';
     Parent:=qrband1;
     Top:=qrlabel1.Top-2;
     Left:=qrlabel1.Left+qrlabel1.Width;
     Height:=qrlabel1.Height div 2;
     Font.Size:=qrlabel1.Font.Size div 2;
    end;
    end;试试行不行!
      

  3.   

    最简单的方法,放两个QRLabel不就可以了?
      

  4.   

    //参数:字体名如‘宋体’,位置,字体大小
    procedure printcm3(fongname;string;var x,y,fsize:integer);
    const
      cm='cm';
    begin
      with Printer.Canvas do
        begin
          Font.Size:=fsize;
          Font.Name:='宋体';
          TextOut(x,y,cm);
          x:=x+TextWidth(cm);
          y:=y-Round(TextHeight(cm)/4);
          Font.Size:=Round(fsize*0.8);
          TextOut(x,y,'3');
        end;
    end;
      

  5.   

    看看智能ABC
        “V+数字”试一试或者对只能ABC的小键盘右键单击找找看