Solved

Detecting mouse over a button

Posted on 1997-04-16
2
411 Views
Last Modified: 2010-05-18
Do you have a Delphi 1 component that is a button that can detect when the mouse is over it, please?
I have the "MsBitBtn" from the Delphi Super Page (http://sunsite.icm.edu.pl/delphi/) and it works fine but not when it is in a form that is scaled. {form width etc scaled and components in it scaled by MyForm.ScaleBy(screen.width, 640)}. The button need not be a BitButton, just an ordinary button will do but it must -
1. Behave like a normal button.
2. Produce an event when the mouse moves into it or moves within it. I can set a flag and ignore multiple OnMoves once the 'entry' has been detected.
3. Produce an event when the mouse moves out of it.
4. It must behave as if it is detecting the position of the mouse, not the crossing of the button boundary- ie it must be able to respond correctly to fast movement in or out without missing the move.
5. It must work in scaled forms.
The MsBitBtn works well (after removing its 'color change') and would give you an exact idea of what I need. It has source code but unfortunately not for its DLL. The ideal would be to write a DLL for MSBitBtn that works when scaled so all I have to do is replace the DLL.
Thanks for your help.
0
Comment
Question by:frog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Expert Comment

by:CFantin
ID: 1335407
Does a normal delphi button not work as it has a OnMouseMove event?
0
 
LVL 1

Accepted Solution

by:
bcrotaz earned 50 total points
ID: 1335408
Create a descendant.
Add two private procedures:

procedure MouseEnter(var Msg: TMessage); message CM_MOUSEENTER;
procedure MouseExit(var Msg: TMessage); message CM_MOUSELEAVE;

Fire an event in each procedure.
If you don't know how to do that, email me:
bryan@ctv.co.uk
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question