我的代码是:stringgrid1.Cells[i, d] := Rom+#13#10+sta;换不了
原先0303VR
现在:0303
    VR

解决方案 »

  1.   

    procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
    var
      i:Integer;
    begin
      if (ACol=1) and (ARow=1) then
      begin
        self.StringGrid1.Canvas.FillRect(Rect);
        Self.StringGrid1.Canvas.Font.Color:=clRed;
        self.StringGrid1.Canvas.TextOut(Rect.Left+1,Rect.Top+1,'0303');
        i:=Self.StringGrid1.Canvas.TextHeight('0303');
        self.StringGrid1.Canvas.TextOut(Rect.Left+1,Rect.Top+i+2,'VR');
      end;
    end;