Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Q: I wanna open a form for 5 sec. How do I do?

0 views
Skip to first unread message

Johan Norrman

unread,
Jul 14, 1996, 3:00:00 AM7/14/96
to

As you see, I wanna show the form and then I wanna close it, and go back to
another form, how do I do??


Jason Wallace

unread,
Jul 15, 1996, 3:00:00 AM7/15/96
to Johan Norrman

Johan Norrman wrote:
>
> As you see, I wanna show the form and then I wanna close it, and go back to
> another form, how do I do??


How about a timer....

Scott & Chris Stewart

unread,
Jul 15, 1996, 3:00:00 AM7/15/96
to

In article <4sbvou$g...@mn5.swip.net> Johan Norrman wrote:
>As you see, I wanna show the form and then I wanna close it, and go back
> to
>another form, how do I do??

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


Martin Larsson

unread,
Jul 15, 1996, 3:00:00 AM7/15/96
to Johan Norrman

Johan Norrman wrote:
>
> As you see, I wanna show the form and then I wanna close it, and go back to
> another form, how do I do??

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

jo...@aries.com.au

unread,
Jul 22, 1996, 3:00:00 AM7/22/96
to

johan....@mailbox.swipnet.se (Johan Norrman) wrote:

>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.


0 new messages