?
Solved

Detecting mouse over a button

Posted on 1997-04-16
2
Medium Priority
?
414 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 100 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

801 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