Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How can to add the hot track effect to my component Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
08-Jun-03
Category
VCL-General
Language
Delphi 2.x
Views
91
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Mike Shkolnik 

How can I add the hot track effect to my component?

Answer:

If you want to add a useful feature to your component (like URL in html or 
PageControl/TabControl.HotTrack) you must handle the CM_MOUSEENTER and 
CM_MOUSELEAVE messages: 

1   type
2     TyourControl = class(TDescControl)
3     private
4       { Private declarations }
5       FLinkFont: TFont;
6       FPassiveFont: TFont;
7   
8       procedure CMMouseEnter(var Msg: TMessage); message CM_MOUSEENTER;
9       procedure CMMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE;
10    end;
11  
12  implementation
13  
14  procedure TyourControl.CMMouseEnter(var Msg: TMessage);
15  begin
16    //Change color when mouse is over control
17    Font.Assign(FLinkFont);
18  end;
19  
20  procedure TyourControl.CMMouseLeave(var Msg: TMessage);
21  begin
22    //Change color when mouse leaves control
23    Font.Assign(FPassiveFont);
24  end;


As example, you can view a sources of the TURLLabel and/or THighLightLabel components on my site (http://www.geocities.com/mshkolni

			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC