我想编一个到计时,从10分钟减到0,请高手赐教!!!
解决方案 »
- Delphi不差钱,差的是框架+鼓吹!
- 高手请进
- Delphi如何读取使用GBK字符集的数据库?在读取中文内容时出现错误,在线等待
- 一个简单的问题
- TOleContainer读入ppt文件,如何让它播放?
- Delphi有没有悾件数组的概念,象VB那样。若有,怎么用?若您第一个回答正确,奉送50分
- 如何在上位机中控制下位机(8031及其它芯片)?
- 关于RichEdit的问题
- 关于DBGridEh控件,数据表中数据已删除,但,该控件中还是存在原来数据,没有更新,怎么办啊?
- 编程会改变人的性格??
- 请问各位达人——DEPHI7的自带压缩控件是哪个?
- 如何获得局域网络中所有的SQL SERVER服务器名。
要的发信息给我。
IntRemain: Integer;procedure TForm1.Timer1Timer(Sender: TObject);
begin
IntRemain := IntRemain - 1;
Label1.Caption := Format('%d:%d', [IntRemain div 60, IntRemain mod 60]);
end;procedure TForm1.FormActivate(Sender: TObject);
begin
IntRemain := 600;
end;
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation
uses
DateUtils;
{$R *.dfm}
var
TimeBegin:TTime;
procedure TForm1.Button1Click(Sender: TObject);begin
Timer1.Enabled:=True;end;procedure TForm1.Timer1Timer(Sender: TObject);
begin
TimeBegin:=IncSecond(TimeBegin,-1);
Label1.Caption:=FormatDateTime('HH:mm:ss',TimeBegin);
// Label1.Refresh;end;procedure TForm1.FormCreate(Sender: TObject);
begin
TimeBegin:=StrToTime('00:10:00');
Timer1.Enabled:=False;
Timer1.Interval:=1000; //1 秒
end;end.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation
uses
DateUtils;
{$R *.dfm}
var
TimeBegin:TTime;
procedure TForm1.Button1Click(Sender: TObject);begin
Timer1.Enabled:=True;end;procedure TForm1.Timer1Timer(Sender: TObject);
begin
TimeBegin:=IncSecond(TimeBegin,-1);
Label1.Caption:=FormatDateTime('HH:mm:ss',TimeBegin);
if FormatDateTime('HH:mm:ss',TimeBegin)='00:00:00' then
Timer1.Enabled:=False;
// Label1.Refresh;end;procedure TForm1.FormCreate(Sender: TObject);
begin
TimeBegin:=StrToTime('00:00:04');
Timer1.Enabled:=False;
Timer1.Interval:=1000; //1 秒
end;end.