本文整理自网络,侵删。
type
TStringGridRowDeletion = class helper for TStringGrid
public
procedure RemoveRows(RowIndex, RCount: Integer);
procedure Clear;
end;
{ TStringGridRowDeletion }
procedure TStringGridRowDeletion.Clear;
var
i: integer;
begin
for i := 0 to RowCount -1 do
RemoveRows(0, RowCount);
end;
procedure TStringGridRowDeletion.RemoveRows(RowIndex, RCount: Integer);
var
i: Integer;
begin
for i := RowIndex to RowCount - 1 do
Rows[i] := Rows[i + RCount];
RowCount := RowCount -RCount;
end;
var
myStringGrid: TStringGrid;
begin
...
myStringGrid.RemoveRows(0, 4);
...
end;
相关阅读 >>
Delphi xe 新功能试用:多种皮肤样式静、动态设置方法
Delphi xe android的所有权限按照分类总结说明
更多相关阅读请进入《Delphi》频道 >>