Solved

Detecting mouse over a button

Posted on 1997-04-16
2
388 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
2 Comments
 
LVL 1

Expert Comment

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

Accepted Solution

by:
bcrotaz earned 50 total points
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now