Solved

Detecting cursor leaving control

Posted on 1998-09-22
2
140 Views
Last Modified: 2010-08-05
How can I detect when the mousecursor leaves a control?
I do some highligting in an ownerdrawn Outline control, and I need to know when the mouse leaves the control, so I can remove the highlighting. (It's a standard mouseover-effect). Im using Delphi 1.0
0
Comment
Question by:pede
2 Comments
 
LVL 10

Accepted Solution

by:
viktornet earned 50 total points
ID: 1340527
You need to override the control and create a component that decends from TOutLine and here is the message to be triggered...
private
  procedure CMMouseEnter(var msg:TMessage); message CM_MOUSEENTER;
  procedure CMMouseLeave(var msg: TMessage); message CM_MOUSELEAVE;

{...}
procedure MyComponent.CMMouseEnter(var msg:TMessage);
begin
    inherited;
    {respond to mouse enter}
end;

procedure MyComponent.CMMouseLeave(var msg: TMessage);
begin
    inherited;
    {respond to mouse leave}
end;
0
 
LVL 1

Author Comment

by:pede
ID: 1340528
I havent got time to check it now, but I assume you are right. This is exactly what I was looking for :)

/Pede

PS. Im SOOOOO tired of Borland (Inprise). Why do they hide all the goodies??? This one should have been a published event!


0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi Form ownership 4 110
Delphi 2 68
Unique identifier on a terminal server (rdp) 4 67
Delphi Firemonkey: if the Sms contain special characters it won't send it 3 43
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 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