DelphiFAQ Home Search:
General :: Windows :: Programming :: Windows with Delphi :: Windows Forms
Code snippets, Q+A around the Windows user interface. From a Delphi perspective, but usually applicable to other languages.


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Only the 40 most recently viewed articles are shown.
You can see the full list here.

Featured Article

Create a 'hot URL link' in the About box

Many programs have an About box with a WWW address in it. When the user clicks on that address, it will launch the webbrowser automatically and connect with the given site.

How to accomplish this?

Create your label component with the URL as it's caption.
Set the font's color to 'blue' and style 'underline' so that it looks like a link.

uses ShellAPI;
 // ..
   TAboutBox = class(TForm)
     // ..
     URLLabel : TLabel;
 // ..
  URLLabel.Cursor := crAppStart; { set this in the object inspector }
 // ..
 // onClick event handler
 procedure TAboutBox.URLLabelClick(Sender: TObject);
 var TempString : array[0..79] of char;
   ShellExecute(0, Nil, TempString, Nil, Nil, SW_NORMAL);
You don't like the formatting? Check out SourceCoder then!
Generated 0:03:06 on Sep 17, 2019