[DUG] Mouse over form

Stacey Verner stacey at cjntech.co.nz
Mon Jul 3 08:25:20 NZST 2006


In OnMouseLeave use Mouse.CursorPos to check theat the mouse is actually
outside the form. If its not then don't do the Leave code, but don't do
the Enter code again too.

Stacey

-----Original Message-----
From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz]
On Behalf Of John Bird
Sent: Sunday, 02 July 2006 10:52
To: 'NZ Borland Developers Group - Delphi List'
Subject: [DUG] Mouse over form

I wish to have a small form be mainly transparent and less transparent
when the mouse moves over it.  The form onMouseEnter and onMouseLeave
are almost perfect, except that moving the mouse to any components on
the form also fires the onMouseLeave event, and the border/title bar
also is not counted as part of the form either.

Question - Is there any way to detect the mouse is anywhere within the
form without having to put mouse events on all components or doing a
continuous monitoring of the mouse position?

The best solution I have so far is to reduce the transparency of the
form on MouseEnter, and leave it so for a few seconds before making it
more transparent again after a few seconds...but its not ideal as this
can happen if the mouse is still within the form.

(One reason I don't want to put events into the components is that one
of them a colorbutton already has a mouseover event to change color)

John


_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi



More information about the Delphi mailing list