天道酬勤,学无止境

定时器例子

一个定时器相关的简单例子 - 回复 "Timer008" 的问题

一个定时器相关的简单例子 - 回复 "Timer008" 的问题 问题来源: http://www.cnblogs.com/del/archive/2008/07/09/1073218.html#1249648 代码文件:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Timer1: TTimer; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Timer1Timer(Sender: TObject); end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin Timer1.Interval := 15000; {定时器每 15 秒执行一次} Timer1.Enabled := False;

2021-05-19 02:30:13    分类:博客    定时器   定时器例子