el stamatakos wrote:
> Hi All,
>  I created a form. I placed a TTimer on this form and a label. The code is 
> like this
> 
> procedure TMainForm.ShowNotification(Msg:String; time:Cardinal);
> var
> MessageForm:TMessageChildForm;
> begin
> MessageForm:=TMessageChildForm.Create(Self);
> MessageForm.Show;
> MessageForm.Visible:=True;
> MessageForm.Label1.Caption:=Msg;
> MessageForm.Timer1.Interval:=time;
> MessageForm.Close;
> end;  
> 
> and the call is
> ShowNotification('Creating directories',5000);
> 
> I assume this is 5 seconds but when I run the app it goes faster then that 
> like not even 1 sec. Anything worng with the code above
> 

You are Closing the form yourself. "MessageForm.Close;"


You need to set the OnTimer Event of Timer1 and in that procedure is
where you call MessageForm.Close;

Also disable the timer when it runs and reenable it when you call
ShowNotification


Happy Coding,

Andrew

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to