G
gyzhen
Unregistered / Unconfirmed
GUEST, unregistred user!
我想使程序在生成界面10秒后显示一条信息,但用下面的代码为什么不行?请高手指点,谢谢!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls,dateutils;
type
TForm1 = class(TForm)
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
st:tdatetime;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
st:=now;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if now=incsecond(st,10) then
showmessage('ok');
end;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls,dateutils;
type
TForm1 = class(TForm)
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
st:tdatetime;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
st:=now;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if now=incsecond(st,10) then
showmessage('ok');
end;
end.