var i:integer; j:integer; canAdd:Boolean; begin canAdd := True; for i:=0 to stringgrid1.RowCount-1 do begin for j:=0 to stringgrid1.ColCount-1 do if stringgrid1.Cells[i,j]='' then canAdd := False; end; if canAdd then stringgrid1.RowCount:=stringgrid1.RowCount+1;end;
这个昨天我也想到了,但是stringgrid1填满了数据后,点击没有增加1行。帮忙再看1下呢?
bdmh 没有错。要么你再多加一点内容。 if trim(stringgrid1.Cells[i,j])='' then
var i:integer;
j:integer;
canAdd:Boolean;
begin
canAdd := True;
for i:=0 to stringgrid1.RowCount-1 do
begin
for j:=0 to stringgrid1.ColCount-1 do
if stringgrid1.Cells[i,j]='' then
canAdd := False;
end;
if canAdd then
stringgrid1.RowCount:=stringgrid1.RowCount+1;end;
这个昨天我也想到了,但是stringgrid1填满了数据后,点击没有增加1行。帮忙再看1下呢?
if trim(stringgrid1.Cells[i,j])='' then