<< Click to display table of contents >> TrvActionInsertHyperlink.DetectURL |
Helps to detect URLs on typing in rve.
procedure DetectURL(rve: TCustomRichViewEdit);
This action checks the text to the left of the caret position, and if its a URL, converts it to a hyperlink.
The function does nothing of the text is already a hyperlink, or if the selection in rve is not empty.
The method uses GetHyperlinkStyleNo for this conversion.
Example:
procedure TForm1.RichViewEdit1KeyPress(Sender: TObject; var Key: Char);
begin
if Key in [#13, #9, ' ', ',', ';'] then begin
rvActionInsertHyperlink1.DetectURL(RichViewEdit1);
rvActionInsertHyperlink1.TerminateHyperlink(RichViewEdit1);
end;
end;