当前位置:网站首页>[3.delphi common components] 7 timer
[3.delphi common components] 7 timer
2022-06-11 02:12:00 【Janeb1018】
7. timer
timer (Timer) An event can be generated in an application at repeated intervals . Is a non visual component . The main attributes are as follows :
| attribute | explain |
|---|---|
| Enabled | The value of this property is True when , start-up , by False when , Suspend work |
| Interval | Set the period triggered by the timer ( Company :ms) |
Major events :
| event | explain |
|---|---|
| OnTimer | The event is Interval The frequency of property setting is triggered |
Example : Electronic clock , At the same time, set the square position of the scroll bar to the second value of the current time , The interface is as follows :

The program code is as follows :
procedure TForm1.RadioButton1Click(Sender: TObject);
begin
Timer1Timer(Sender);
end;
procedure TForm1.RadioButton2Click(Sender: TObject);
begin
Timer1Timer(Sender);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
h, m, s, ms: Word;
CurrentTime: TDateTime;
begin
// Electronic clock
CurrentTime := time;
if RadioButton1.Checked then
Label2.Caption := formatdatetime('ampmhh:nn:ss', CurrentTime)
else
Label2.Caption := formatdatetime('hh:nn:ss', CurrentTime);
DecodeTime(CurrentTime, h, m, s, ms);
ScrollBar1.Position := s;
end;边栏推荐
- [matlab] basic image operation (point operation, arithmetic operation, scaling and rotation)
- [Qt] Erreur: qapplication: No such file or directory Solution
- What should be paid attention to in PMP registration? Special reminder
- Thoughts on small steamed stuffed bun's dividend
- 腾讯面试官曰Mysql架构的内部模块索引原理及性能优化思路谁会?
- 【MATLAB】图像变换(傅里叶变换、离散余弦变换)
- NFT Insider #61:Animoca Brands 在 340 项投资中持有 15 亿美元的加密资产
- Union find
- [error record] Android application security detection vulnerability repair (strandhogg vulnerability | set activity component android:taskaffinity= "")
- Win11怎么更改管理员头像?Win11更换管理员头像的方法
猜你喜欢

QT database learning notes (II) QT operation SQLite database

浅析直播间海量聊天消息的架构设计难点

(已解决)Latex--取消正文中参考文献引用的上标显示(gbt7714-2015会导致默认上角标引用)(上角标&平齐标混合使用教程)

Byte Beijing 23K and pinduoduo Shanghai 28K, how should I choose?

从测试零基础到测试架构师,这10年,他是这样让自己成才的

软测人都该知道的七大原则

adb 常用命令解析

1个月不到暴增900万播放量,B站3个流量增长密码!

In the past 10 years, from zero foundation testing to test architect, he has made himself successful

Fb02 edit coding block field
随机推荐
27岁女生零基础转行软件测试,合适吗?
Orcale driver
Flutter status management
C DataGrid binding data
Our understanding of the industrial Internet may be more out of the existing logic
【MATLAB】图像增强(幂次变换、直方图规定化处理方法、平滑、锐化滤波)
Database overview
[matlab] basic operation of MATLAB image processing
How to change the theme of win11 touch keyboard? Win11 method of changing touch keyboard theme
【MATLAB】图像分割
cannot import name ‘dtensor‘ from ‘tensorflow.compat.v2.experimental‘
Contest2902 - following Tang Kelian's programming: sequence structure question d: area 201502 question f: persistence of supporting college students in Ludian earthquake
AI fanaticism | come to this conference and work together on the new tools of AI!
Seven principles that should be known by software testers
Today's sleep quality record 80 points
[music] playing "over fire" based on MATLAB [including Matlab source code 1875]
Record the actual record of my question brushing
[Qt] Erreur: qapplication: No such file or directory Solution
记录一下我的刷题实录
Me11/me12 purchase information record and condition record creation and update bapi:me_ INFORECORD_ MAINTAIN_ MULTI