Re: Label Visibilty


Posted by Jeff on February 28, 2001 at 23:56:50:

In Reply to: Label Visibilty posted by Hannah on February 23, 2001 at 11:57:20:

: How do i make a label visible for 10 seconds only?

Here is one way to it. At design time, make the label visible property false. Then use a while loop to display the label for ten seconds.

Here's the code:

procedure Form1.Button1Click(Sender: TObject);
var StartTime, Delay : double;
i : integer;
begin
StartTime := Time;
Delay := 10/24/3600;

while ((StartTime + Delay) > Time) do
begin
label.Visible := True;
Application.ProcessMessages;
end;

label2.Visible := False;end;
end;