📄 unit1.pas
字号:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Mask;
type
TForm1 = class(TForm)
Timer1: TTimer;
Button1: TButton;
Label1: TLabel;
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
h,n,s,m,a:integer;
hh,nn,ss:string;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
m:=timer1.tag+1;
timer1.Tag:=m;
n:=m div 60;
s:=m mod 60;
h:=n div 60;
n:=n mod 60;
if n < 10 then
nn:= '0' + inttostr(n)
else
nn:=inttostr(n);
if s < 10 then
ss:='0' + inttostr(s)
else
ss:=inttostr(s);
label1.Caption:=nn + ':'+ ss;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Timer1.Enabled:=true;
//timer1.tag:=(0+1);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -