Delphi 删除或清除TStringGrid中的行


本文整理自网络,侵删。

 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 android权限

Delphi分享pos函数。(比fastpos还要快)

Delphi检测用户超过5分钟没有操作键盘或鼠标

Delphi xe 新功能试用:多种皮肤样式静、动态设置方法

Delphi实现背景音乐播放

Delphi xe android的所有权限按照分类总结说明

Delphi 下载并运行的代码

Delphi操作文本文件简介

Delphi常用数据类型

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



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...