hallo daniel:
Delphi-Quellcode:
var
s:string;
begin
if ( Acol < 1 ) or (Arow < 1) then exit;
with stringgrid1 do begin
rect:= stringgrid1.cellrect(acol,arow);
s:= stringgrid1.cells[acol,arow];
stringgrid1.Canvas.FillRect(rect);
drawtext(stringgrid1.canvas.handle,pchar(s),length(s),rect,dt_center or dt_wordbreak);
end;
end;
das in dein drawcell rein
Delphi-Quellcode:
var
s:=string;
begin
s:='erster'+#13#10+'zweiter';
stringgrid1.cells[stringgrid1.col,stringgrid1.row]:= s;
end;
das in ein ereignisrein am besten in ein buttonclick.