timer实现Grid自动换行(连续相同的id跳到下一行)
2015-11-06 15:23
344 查看
private { Private declarations } FRow: Integer; procedure SetRow(const Value: Integer); public { Public declarations } property Row : Integer read FRow write SetRow default -1; // 属性 end; implementation {$R *.fmx} { Tfrm } procedure Tfrm.SetRow(const Value: Integer); begin if(Value<>FRow) then begin FRow:=Value; G1.SelectRow(Value); Timer1.Interval:=G1.Cells[3,Value].ToInteger(); end; end; procedure Tfrm.Timer1Timer(Sender: TObject); var n, i, j: Integer; begin n := FRow + 1; // 当前行位置 j := 0; // IP相同的个数 if n < G1.RowCount - 1 then // 防止超界 begin for i := 0 to G1.RowCount - 1 do begin if i + 1 < G1.RowCount - 1 then if (G1.Cells[0, FRow] = G1.Cells[0, FRow + i]) then // 判断相邻行IP的相同个数 若相同则相加否则退出循环 Inc(j) else break; end; if j <> 0 then n := FRow + j; end; if (n >= G1.RowCount - 1) then n := 0; Row := n; end;
相关文章推荐
- python时间相关
- [bootstrap] 实用的bootstrap模版下载
- The method getDispatcherType() is undefined for the type HttpServletRequest
- jsp页面中修改html元素内容关于单双引号的错误笔记
- 网格部件设置字段样式的智能向导不起作用??
- spring hadoop系列二(MapReduce and Distributed cache)
- 安装成功的nginx,如何添加未编译安装模块(非覆盖安装http_image_filter_module)
- 5 个免费的受欢迎的 SQLite 管理工具
- java 十进制与六十二进制
- 让textview可以滚动
- String.prototype.trim= function(){ return this.replace(/(^\s*)|(\s*$)/g, ""); };
- 安装成功的nginx,如何添加未编译安装模块(非覆盖安装http_image_filter_module)
- zf2 apache跳转 404 not found
- Verilog中task使用
- UIKit与Quartz2D绘图技术
- springmvc + ajaxFileUpload多文件上传
- 抽象类的用法
- 在CordovaActivity中添加原生View组件
- springmvc3.2+mybatis3.2 实现大文件的上传
- 百度地图HTML接口