Re: Simulating hyperlinks in Delphi

[ Related Articles and Replies ] [ DelphiLand Discussion Forum ]

Posted by webmaster Guido on February 19, 2003

In Reply to: Using hyperlinks inside a program posted by SCFREAK on February 19, 2003

: It seems like a noobish question, but how to do use hyperlinks inside a Delphi program?


1. Add a label to the form with the text that you want to display. Example:
Label1: Caption: DelphiLand

2. Let the user know that it is a hyperlink :) so change the following properties:
- Font.Color : clBlue
- Font.Style : set fsUnderline to True

3. Create an OnClick event handler for the label:

procedure TForm1.Label1Click(Sender: TObject);
  HTML_File: string;
  HTML_File := '';
  ShellExecute(Handle, 'open', PChar(HTML_File),    
   nil, nil, SW_SHOW);

For an example, see DelphiLand's section "Code Snips": "Running an external application".

Related Articles and Replies:

[ Related Articles and Replies ] [ DelphiLand Discussion Forum ]