W
wohoot
Unregistered / Unconfirmed
GUEST, unregistred user!
源码:
program Project1;
uses
Forms,dateutils,SysUtils,
main in 'main.pas' {Fmain},
page1 in 'page1.pas' {Fpage1};
{$R *.res}
var
time1:TDateTime;
begin
Fpage1:=Tfpage1.Create(Application);
Fpage1.Show;//page1为启动窗体
Fpage1.Refresh;
time1:=NOW;
repeat
until time1+time1+time1+5/24*60*60<=now;//延时5秒
Application.Initialize;
Application.CreateForm(TFmain, Fmain);
Application.Run;
end.
unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls,page1;
type
TFmain = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Fmain: TFmain;
implementation
{$R *.dfm}
procedure TFmain.FormShow(Sender: TObject);
begin
Fpage1.Free;
end;
end.
问题:要求启动窗体延时5秒。但编译时不能完成,没有错误提示,只能强行结束,请教高手该怎么样修改?
program Project1;
uses
Forms,dateutils,SysUtils,
main in 'main.pas' {Fmain},
page1 in 'page1.pas' {Fpage1};
{$R *.res}
var
time1:TDateTime;
begin
Fpage1:=Tfpage1.Create(Application);
Fpage1.Show;//page1为启动窗体
Fpage1.Refresh;
time1:=NOW;
repeat
until time1+time1+time1+5/24*60*60<=now;//延时5秒
Application.Initialize;
Application.CreateForm(TFmain, Fmain);
Application.Run;
end.
unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls,page1;
type
TFmain = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Fmain: TFmain;
implementation
{$R *.dfm}
procedure TFmain.FormShow(Sender: TObject);
begin
Fpage1.Free;
end;
end.
问题:要求启动窗体延时5秒。但编译时不能完成,没有错误提示,只能强行结束,请教高手该怎么样修改?