什么是DelphiVCL.Timer在DelphiVCL的Windows UI工具包中?

168 阅读1分钟

作为DelphiVCLWindows UI工具包的一部分,DelphiVCL. TimerTTimer被用来封装Windows API的定时器函数。

TTimer用于简化调用Windows API的定时器函数SetTimer和KillTimer,并简化处理WM_TIMER消息。在应用程序中的每个定时器使用一个定时器组件。

计时器的执行通过其OnTimer事件发生。TTimer有一个Interval属性,决定了定时器的OnTimer事件发生的频率。这个时间间隔与Windows API SetTimer函数的参数相对应。

警告。 对全系统的定时器总数的限制是与系统有关的。

让我们用dir()命令浏览DelphiVCL.Timer的所有属性、方法和内置属性。

import DelphiVCL

dir(DelphiVCL.Timer)

请看我们的Windows命令提示符中的反应。

What Is A DelphiVCL.Timer In The DelphiVCL Windows UI Toolkit. The properties, listed

你也可以用print()命令来阅读关于DelphiVCL.Timer 的简短信息。

print(DelphiVCL.Timer)
print(DelphiVCL.Timer.__doc__)

在我们的Windows命令提示符中看到响应。

What Is A DelphiVCL.Timer In The DelphiVCL Windows UI Toolkit - responses