Delphi 删除或清除TStringGrid中的行

2022-12-27 10:51:17 作者:admin

本文整理自网络,侵删。

 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 分离网址链接最后一层文件目录

Delphi 数字签名添加器源码

Delphi 从摄像头获取照片并转换为特定的格式

Delphi如何判断系统是否安装了flash插件

Delphi windows的消息传递--消息盒子

Delphi tstringlist 文本文件拼接

Delphi webbrowser 加载html成web

Delphi 加载excel 导入数据库

Delphi xe5 为android增加启动图片显示

Delphi中判断tcp端口是否被占用

更多相关阅读请进入《Delphi》频道 >>



在线咨询 拨打电话