📄 unit0604200132.~pas
字号:
unit Unit0604200132;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
ButtonStart: TButton;
Label2: TLabel;
ButtonStop: TButton;
ButtonCon: TButton;
ButtonPause: TButton;
Timer1: TTimer;
edit: TEdit;
Labelhour: TLabel;
LabelSec: TLabel;
LabelMin: TLabel;
Label3: TLabel;
Label4: TLabel;
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
hour,minute,second,hour1,tim:integer;
time:integer=0;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
tim:=strtoint(edit.Text);
time:=time+1;
hour:=time div 3600;
hour1:=time mod 3600;
minute:=hour1 div 60;
second:=hour1 mod 60;
if(hour<9)
then labelhour.caption:='0'+inttostr(hour)
else labelhour.caption:=inttostr(hour);
if(minute<9)
then labelmin.caption:='0'+inttostr(minute)
else labelhour.caption:=inttostr(hour);
if(second<9)
then labelsec.caption:='0'+inttostr(second)
else labelsec.caption:=inttostr(second);
if(time=tim)then
begin
timer1.enabled:=false;
labelhour.caption:='00';
labelmin.caption:='00';
labelsec.caption:='00';
messagedlg('计时结束',mtinformation,[mbOk],0);
end
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -