0

I used this thread to add hyperlinks to my TRichEdit components. But, since installing the new Delphi 11, they have stopped working.

Has anyone figured out why yet?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770

1 Answers1

2

The TRichEdit Component was updated to RichEdit 4.1 in Alexandria, so you do not need any hocus pocus in order to get URL links to work anymore.

Just set TRichEdit's EnableURL to true in the property window (or via code), write some code in the TRichEdit's OnLinkClick event to be fired when the link is clicked, and off you go.

Eirik A.
  • 447
  • 1
  • 5
  • 11
  • 2
    This change is mentioned in 11.0's release notes: [What's New: TRichEdit Component updated to RichEdit 4.1 (MSFTEDIT.dll)](https://docwiki.embarcadero.com/RADStudio/Alexandria/en/What%27s_New#TRichEdit_Component_updated_to_RichEdit_4.1_.28MSFTEDIT.dll.29) – Remy Lebeau Nov 10 '21 at 01:03
  • 1
    I do wonder, however, how this feature is actually implemented (I don't have 11.0). Is it just using `EM_AUTOURLDETECT`? I'm assuming so. There are other aspects to hyperlinks that I wonder if they are covered. Enabling the `CFE_LINK` effect on selected text should be covered by the `SelAttributes.Link` property, but creating friendly-name hyperlinks requires more work that doesn't appear to be covered by `TRichEdit` at all (combination of `CFE_LINK`, `CFE_LINKPROTECTED`, `CFE_HIDDEN` and `"HYPERLINK "` prefix). – Remy Lebeau Nov 10 '21 at 01:15