[求助]有关stringgrid的问题
我想显示时间到stringgrid1.cells上,
代码是:
procedure TForm1.Button1Click(Sender: TObject);
var
i,j:integer;
s:array[1..10,1..10]of string;
rect:trect;
begin
for i:=1 to 5 do
case j of
1: stringgrid1.Cells[j,i]:=timetostr(DateTimePicker3.DateTime);
else stringgrid1.Cells[j,i]:='nihao';
end;
s[i,j]:=stringgrid1.Cells[j,i];
for i:=1 to 5 do
for j:=1 to 5 do
begin
rect:=stringgrid1.cellrect(j,i);
stringgrid1.canvas.textout(rect.left,rect.top,s[i,j]);
end;
end;