照下面的方法做,肯定可以
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;
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;
照下面的方法做,肯定可以
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;