Thanks for your quick reply!
I'm still confused though....
This is what i have done:
- start new project
- added label1 and label2 to the form
Then I changed the source code according to your reccomendation:
unit formulier1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
procedure Label1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.URLLabelMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
OpenURL(TLabel(Sender).Caption);
end;
procedure TForm1.URLLabelMouseLeave(Sender: TObject);
begin
TLabel(Sender).Font.Style := [];
TLabel(Sender).Font.Color := clBlue;
TLabel(Sender).Cursor := crDefault;
end;
procedure TForm1. URLLabelMouseEnter(Sender: TObject);
begin
TLabel(Sender).Font.Style := [fsUnderLine];
TLabel(Sender).Font.Color := clRed;
TLabel(Sender).Cursor := crHandPoint;
end;
end.
When I try to run it I get the messages:
method identifier expected (several times)
Identifier not found "openurl"
I think I miss some lines......