Hidden panel

I have a project which has a main form controling various events linked to a TTimer component set for 1 second.
The main form has a button which calls another form which has various panels on it. The user can move the mouse over a panel to bring up a second hidden panel using the following procedures

procedure TForm2.CMMouseEnter(var Message: TMessage);
begin
 if Message.LParam = Integer(panel1) then
     Panel2.Visible := true;
end;

procedure TForm2.CMMouseLeave(var Message: TMessage);
begin
 if Message.LParam = Integer(panel1) then
     Panel2.Visible := False;
end;

However as soon as the TTimer on the main form is enabled the above procedure doesnt work

Can anyone help?
Al_ShepstoneAsked:
Who is Participating?
 
GloomyFriarCommented:
It's not a good decision to put long time procedures in OnTimer.
Use a thread instead.

To solve your problem use Application.ProcessMessages.
0
 
Tomas Helgi JohannssonCommented:
What does the TTimer Event do ?

Regards,
  Tomas Helgi
0
 
Al_ShepstoneAuthor Commented:
It is a timer which can call procedures at various intervals ie every second.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.