Solved

Detecting cursor leaving control

Posted on 1998-09-22
2
139 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

803 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