How about a timer....
Drop a timer on the form and set it for 5000.
Create an 'onpaint' handler for the form with the line
Timer1.Enabled := True;
Create an 'ontimer' handler for the timer with the line
YourForm.Close; or YourForm.Destroy, whichever you need.
hth,
=scott
Delphi 1: Timer
Delphi 2: Sleep(5000) (unless you want to do something useful in
those 5 seconds that is, if so, use a timer.
M.
--
Martin Larsson, author of several unknown utilities for DOS and Windows.
mailto:martin....@delfi-data.msmail.telemax.no
http://www.delfidata.no/users/~martin
X.400:G=martin;S=larsson;O=delfi-data;P=msmail;A=telemax;C=no
>As you see, I wanna show the form and then I wanna close it, and go back to
>another form, how do I do??
2 ways.
1 - Place a timer component on form, Set it's event procedure to
execute a close, set it's timer to 5 seconds (5000). Do a showmodal on
the form
2 - Create a DELAY procedure (following).
execute a show (not showmodal) on your form, delay(5000), then
free your form.
Delay procedure -
uses wintypes;
procedure delay(amount : longint);
{Delay for AMOUNT miliseconds}
var start_time:longint;
begin
start_time:=gettickcount;
repeat
application.processmessages; {allow other applications to function
while in delay}
until abs(gettickcount-start_time)>amount;
end;
John Williams
Technical Director
Aries Australia
Jo...@aries.com.au
http://www.aries.com.au/
The Home of PHONECONTROL.