?? 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 + -