간단하게 아래 같이 하면 되긴 하겠죠.. ^^
<!--CodeS-->
procedure TForm1.btn1Click(Sender: TObject);
var
i, j : integer;
cnt : integer;
xpos : Integer;
begin
cnt := 1;
for i:=0 to 4 do
begin
for j:=0 to 4 do
begin
if i mod 2 = 0 then xpos := j
else xpos := 4 - j;
grd1.Cells[ xpos, i] := intTostr(cnt);
inc(cnt);
end;
end;
<!--CodeS-->
procedure TForm1.btn1Click(Sender: TObject);
var
i, j : integer;
cnt : integer;
xpos : Integer;
begin
cnt := 1;
for i:=0 to 4 do
begin
for j:=0 to 4 do
begin
if i mod 2 = 0 then xpos := j
else xpos := 4 - j;
grd1.Cells[ xpos, i] := intTostr(cnt);
inc(cnt);
end;
end;
end;
<!--CodeE-->