風 風 Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-07 #2 做一個循環, var i,j:integer; with StringGrid1 do for I := 0 to ColCount - 1 do for J:= 0 to RowCount - 1 do begin Cells[I,J] := ''; end;
做一個循環, var i,j:integer; with StringGrid1 do for I := 0 to ColCount - 1 do for J:= 0 to RowCount - 1 do begin Cells[I,J] := ''; end;
Y yhaochuan Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-07 #3 //删除Cells内容,但不包括上面固定的行。 procedure ClearStringGridContent(StringGrid:TStringGrid); var i:Integer; begin with StringGrid do begin for i:= RowCount - 1 DownTo RowCount - 1 - FixedRows do//如果要删除包括上面固定的行,则将 DownTo后的内容改为0 Rows.Text := ''; end; end;
//删除Cells内容,但不包括上面固定的行。 procedure ClearStringGridContent(StringGrid:TStringGrid); var i:Integer; begin with StringGrid do begin for i:= RowCount - 1 DownTo RowCount - 1 - FixedRows do//如果要删除包括上面固定的行,则将 DownTo后的内容改为0 Rows.Text := ''; end; end;
B bluerain Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-08 #4 var i : integer; begin for i := Stringgrid1.FixedRow to stringgrid1.RowCount do stringgrid1.rows.Clear; end;
var i : integer; begin for i := Stringgrid1.FixedRow to stringgrid1.RowCount do stringgrid1.rows.Clear; end;
W wuyunduo Unregistered / Unconfirmed GUEST, unregistred user! 2002-02-07 #6 我用的方法是改变stringgrid的rowcount为1(若有固定行),然后再改成自已需要的行数, 不知是否适合你用!
S springcat Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-10 #7 将rowcount改为1不行的,当新增加行的时候,原来的内容还是在那里。
C CDA Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-10 #9 var i : integer; begin for i := 0 to stringgrid1.ColCount -1 do stringgrid1.Cols.Clear; end;
W WebExplorer Unregistered / Unconfirmed GUEST, unregistred user! 2002-05-16 #10 其实很简单 用StringGrid.cells[j]就OK