so vielleicht? (mal fix zusammengeschustert)
Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
var i,j:integer;
begin
for i:=0 to stringgrid1.colcount-1 do
begin
for j:=0 to stringgrid1.rowcount-1 do
begin
stringgrid1.cells[i,j]:='('+IntToStr(i)+'-'+IntToStr(j)+')';
end;
end;
randomize;
end;
procedure TForm1.StringGrid1DrawCell(Sender: TObject; Col, Row: Integer;
Rect: TRect; State: TGridDrawState);
var i,p,r:integer;
s:string;
begin
s:=stringgrid1.cells[col,row];
p:=rect.left+4;
stringgrid1.canvas.FillRect(rect);
for i:=1 to length(s) do
begin
r:=random($FFFFFF);
with stringgrid1.Canvas do
begin
Font.Color:=r;
textout(p,rect.top+4,s[i]);
p:=p+textwidth(s[i]);
end;
end;
end;
HTH Frank