timer实现Grid自动换行(连续相同的id跳到下一行)
2024-08-31 15:26:09
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;
最新文章
- 个人博客 week1
- 条款9:不要在构造和析构过程中调用virtual函数
- samba linux windows 请联系管理员
- RBAC(Role-Based Access Control)基于角色的访问控制
- postman接口测试工具3.0版本的坑
- centos/linux 禁止root用户远程登录
- linux shell通配符及if语句判断
- Spring ES
- java基础3之IO
- 框架-thrift-zookeeper-kafka
- Web jsp开发学习——网上直播聊天室的简单开发
- python中pass语句的作用是什么
- Python UDP实例
- 深入理解Linux内核-定时测量
- WCF中的异常
- pythone 请求响应字典
- Guava包学习--Table
- 【转】使用Jmeter录制web脚本
- Spring之BeanFactory与ApplicationConText
- 使用Gulp压缩IMG
热门文章
- mysql函数之六:mysql插入数据后返回自增ID的方法,last_insert_id(),selectkey
- Jenkins设置自动发邮件
- Vue源码学习(一):调试环境搭建
- Angular2快速入门-2.创建一个新闻列表
- Android的按钮单击事件及监听器的实现方式
- mysql整数类型
- Py修行路 python基础 (五)三元运算 字符编码 元组 集合 三级菜单优化!
- java常见的几种调用机制(同步调用,异步调用,回调)
- python学习——练习题(3)
- 12个有趣的c语言面试题&;nbsp;