?
Solved

OnMouseEnter and OnMouseLeave

Posted on 2005-03-15
3
Medium Priority
?
1,099 Views
Last Modified: 2008-01-09
What kind of trick to implement that ?

I want to make a descendant of TImage that have those events.

Anyone willing to share the codes ?

Thanks.
0
Comment
Question by:muis2002
[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
3 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 13546546
just catch the messages

CM_MOUSEENTER
CM_MOUSELEAVE

sample follows

meikl ;-)
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 660 total points
ID: 13546628
well, the sample:

unit Meiklimage;

interface

uses
  SysUtils, Classes, Controls, ExtCtrls, messages;

type
  TMeiklimage = class(TImage)
  private
    fOnMouseEnter : TNotifyEvent;
    fOnMouseLeave : TNotifyEvent;
  protected
    procedure CMMouseEnter(var Msg: TMessage); message CM_MOUSEENTER;
    procedure CMMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE;
  public
    { Public declarations }
  published
    property OnMouseEnter : TNotifyEvent read fOnMouseEnter write fOnMouseEnter;
    property OnMouseLeave : TNotifyEvent read fOnMouseLeave write fOnMouseLeave;
  end;



procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Samples', [TMeiklimage]);
end;

procedure TMeiklimage.CMMouseEnter(var Msg: TMessage);
begin
  if assigned(fOnMouseEnter) then
    fOnMouseEnter(self);
  inherited;
end;

procedure TMeiklimage.CMMouseLeave(var Msg: TMessage);
begin
  if assigned(fOnMouseLeave) then
    fOnMouseLeave(self);
  inherited;
end;


end.


meikl ;-)
0
 

Author Comment

by:muis2002
ID: 13548052
Thanks meikl :)
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
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 …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

762 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