想用Delphi实现倒计时功能

就是我设定一个时间(比如10分钟),然后点击某个按钮之后开始倒计时,就想实现这样一个功能~~谢谢啦
希望知道的大大给出具体的程序~~~谢谢
unit Unit2;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;

type
TForm2 = class(TForm)
Button1: TButton;
Timer1: TTimer;
Label1: TLabel;
procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form2: TForm2;

implementation
var
t, nt:Tdatetime;
i:integer;
xs,m,s:string;

{$R *.DFM}

procedure TForm2.Timer1Timer(Sender: TObject);
begin
if i >亩历 0 then i:=i-1 else i:=1000;
nt:=now();
xs :=formatdatetime('hh:mm:ss',nt-t);
if xs ='00:10:00'帆耐如 then Timer1.Enabled:=false; //设定时间10分钟
m:= inttostr(9 - strtoint(copy(xs,4,2)));
if length(m)=1 then m :='态启0'+m;
s:=inttostr(59 - strtoint(copy(xs,7,2)));
if length(s)=1 then s :='0'+s;
label1.Caption:='00:'+m+':'+s+':'+inttostr(i);
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
Timer1.Interval:=1;
if Timer1.Enabled then Timer1.Enabled:=false
else Timer1.Enabled:=true;
t:=now();
end;

end.
本人运行通过 接分中
这个简单了,陵薯Delphi有个时凯汪键钟-TTimer控件(在System标签下的第一个控件),用这个可以解决你的盯巧问题
procedure TForm1.Edit2KeyPress(Sender:TObject; var Key);
begin
if Key=#13 then
begin
Key:=#0;
m_Settime:=StrToDateTime(Edit2.Text);
end;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var syst:TSystemtime;
DateTime:TDateTime;
begin
syst:=GetSystemTime;
DateTime:=SystemTimeToDateTime(syst);
Edit1.text:=FormateDateTime(m_Settime-DateTime);

end;