照下面的方法做,肯定可以
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
begin
   StringGrid1.Canvas.FillRect(Rect);
   DrawText(StringGrid1.Canvas.Handle,Pchar(StringGrid1.Cells[2, 2]), Length(StringGrid1.Cells[2, 2]),
    Rect,DT_TOP or DT_LEFT);
end;

解决方案 »

  1.   

    回复人: victorlee_lq(victor) (2001-8-22 18:30:57)  得0分 
    照下面的方法做,肯定可以
    procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
    begin
      StringGrid1.Canvas.FillRect(Rect);
      DrawText(StringGrid1.Canvas.Handle,Pchar(StringGrid1.Cells[2, 2]), Length(StringGrid1.Cells[2, 2]),
        Rect,DT_TOP or DT_LEFT);
    end;