在form1窗体上加个timer控件
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;
type
TForm1 = class(TForm)
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
time1:integer;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
form1.Timer1.Interval:=25;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
time1:=time1+1;
if (time1=3) then
begin
form1.Visible:=false;
form2.Visible:=true;
end;
end;
end.