以下为代码
procedure tform1.clk(cap:string);
var s:string;
begin
rowno:=stringgrid1.Row;
colno:=stringgrid1.Col;
stringgrid1.Cells[colno,rowno]:=cap;
case colno of
0: begin colno:=1; s:=inputbox('','input the first page',''); stringgrid1.Cells[colno,rowno]:=s; if rowno<15 then begin stringgrid1.Col:=0; stringgrid1.Row:=stringgrid1.Row+1; end else stringgrid1.Col:=2;stringgrid1.Row:=1;end;
2: begin colno:=3; s:=inputbox('','input the first page',''); stringgrid1.Cells[colno,rowno]:=s; if rowno<15 then begin stringgrid1.Col:=2; stringgrid1.Row:=stringgrid1.Row+1;end else edit2.focused; end;
end;
end;
stringgrid组件中有4列15行,希望能在每次输入后能实现自动跳行。以上有什么问题呢?
procedure tform1.clk(cap:string);
var s:string;
begin
rowno:=stringgrid1.Row;
colno:=stringgrid1.Col;
stringgrid1.Cells[colno,rowno]:=cap;
case colno of
0: begin colno:=1; s:=inputbox('','input the first page',''); stringgrid1.Cells[colno,rowno]:=s; if rowno<15 then begin stringgrid1.Col:=0; stringgrid1.Row:=stringgrid1.Row+1; end else stringgrid1.Col:=2;stringgrid1.Row:=1;end;
2: begin colno:=3; s:=inputbox('','input the first page',''); stringgrid1.Cells[colno,rowno]:=s; if rowno<15 then begin stringgrid1.Col:=2; stringgrid1.Row:=stringgrid1.Row+1;end else edit2.focused; end;
end;
end;
stringgrid组件中有4列15行,希望能在每次输入后能实现自动跳行。以上有什么问题呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货