Prøv denne kode, som jeg har fundet på nettet:
procedure TForm1.InitRichEditURLDetection(RE: TRichEdit);
var
mask: Word;
begin
mask := SendMessage(RE.Handle, EM_GETEVENTMASK, 0, 0);
SendMessage(RE.Handle, EM_SETEVENTMASK, 0, mask or ENM_LINK);
SendMessage(RE.Handle, EM_AUTOURLDETECT, Integer(True), 0);
end;
procedure TForm1.FormCreate(Sender: TObject);
var
s: string;
begin
InitRichEditURLDetection(RichEdit1);
s:='Great Delphi tutorials and articles at ' +
'
http://www.delphi.about.com.' + #13#10 +
'About Delphi Programming site!' + #13#10 +
'Send an email to your Guide: mailto:delphi.guide@about.com';
RichEdit1.Text := s;
s:= '
http://www.delphi.about.com. ' +
' This Rich Edit does not recognize URLs!';
RichEdit2.Text := s
end;