Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

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?
0
Al_Shepstone
Asked:
Al_Shepstone
1 Solution
 
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
 
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now