«« Site Rescued »»

While the site is still going to move from its current host, a new site will now take its place. More Info.

The new site may have less content, but the core will now remain. And it will now play nicely with phones! Keep an eye on the DelphiDabbler Blog for news.

Hot Label Component

Release: 2.2.1
Date: 14 February 2016
Delphi Compatibility:
D1 D2 D3 D4 D5 D6 D7 D2005 D2006 D2007 D2009 D2010 DXE DXE2 DXE3 DXE4
Red LED Red LED Red LED Grey LED Grey LED Grey LED Green LED Grey LED Green LED Green LED Green LED Green LED Green LED Green LED Green LED Green LED


TPJHotLabel is a simple Delphi component that descends from TLabel. It provides a click-able label that can start the default browser or email client to access a specific URL. Key features of the component are:

  • All properties of TLabel are supported, although the usage and default values of some of the inherited properties have been changed.
  • The URL property is used for storing the URL to be accessed when the label is clicked and the Caption property can either store descriptive text or can reflect the URL, depending on the value of the CaptionIsURL property. The ability to link the Caption and URL makes it easy to display the URL without having to keep two properties synchronised.
  • The URL can be validated to check for supported protocols. This validation is switched on and off using the ValidateURL property. Supported protocols are:
    • http://
    • https://
    • mailto:
    • file:
    • ftp://
  • The label's Font property defaults to a navy blue to indicate a link.
  • The label can be highlighted when the mouse passes over it. Highlighting is used if the HighlightURL property is True, and the font used for highlighting is set using the HighlightFont property.
  • The label can also display in a different style when its "link" has been clicked successfully. The font to be used is specified via the VistedFont property. The user can switch the visited state on and off via the Visited property or the component can be enabled to track visits automatically using the TrackVisits property.
  • The label displays the "hand point" cursor by default.
  • The component's pop-up hints can be customised as follows, using the HintStyle property:
    • the hint text can come from the Hint property as normal,
    • the hint text can come from the URL property with the Hint property being ignored,
    • the hint text can be modified just before the hint is shown by handling the OnCustomHint event, which is useful for displaying dynamic information in the hint.


The component has comprehensive online documentation.

Demo Program

A demo program is included in the download. See the Demo sub-directory.

How it works

The component functions mainly as a standard TLabel except that:

  1. It handles the Delphi-specific CM_MOUSEENTER and CM_MOUSELEAVE messages to highlight the label when the mouse is over it.
  2. It handles Delphi's CM_HINTSHOW message to provide customised hints.
  3. The Caption property may automatically change when the optionally linked URL property changes.

TPJHotLabel uses the Windows ShellAPI ShellExecute function to start the default browser or email client when a URL is clicked.

Feedback & Queries

If you find any bugs or want to suggest a new feature please report them using the Issue Tracker.

Click the Create Ticket button to create a ticket then complete the form giving as much information as possible. Please note: this issue tracker is shared among all the projects in the DelphiDabbler Code Library, so please make sure you enter hotlabel in the Project edit box. You should also choose Defect in the Type drop down list to report a bug or Enhancement to request a new feature.

If you have created a bug fix or have implemented a new feature please attach a zip file to your ticket that contains your source code.

Should you have any queries about using the components please read the documentation.

If you can't find an answer in the documentation then post a message in the discussion group.

Please do not email me or use the contact page to report bugs, ask for new features or to find out how to use the component.
I'm afraid I have very limited time available to support the code library, and can't guarantee I'll find time for personalised advice.