How to Implement Custom Hyperlink Handling in TRichView with Delphi?

General TRichView support forum. Please post your questions here
Post Reply
fr3y@_cu113n
Posts: 1
Joined: Sat May 31, 2025 8:40 am

How to Implement Custom Hyperlink Handling in TRichView with Delphi?

Post by fr3y@_cu113n »

Hi all,
I’m using TRichView in a Delphi 11 project to display rich text with hyperlinks. I want to implement custom hyperlink handling so that clicking a link triggers a specific action in my app (e.g., opening a custom form) instead of the default browser. I’ve looked at the OnRVHyperlink event, but I’m struggling to get it working correctly.

Can anyone share a code example or explain the best way to handle custom hyperlink clicks in TRichView? I’m using the latest TRichView version (21.x). Any help or pointers would be greatly appreciated
Sergey Tkachenko
Site Admin
Posts: 17838
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: How to Implement Custom Hyperlink Handling in TRichView with Delphi?

Post by Sergey Tkachenko »

The correct event is OnJump
The help topic has an example code how to get a target of the clicked link (assuming that this target is stored in the item's tag).

PS: there is no OnRVHyperlink event. There is OnReadHyperlink event that occurs when reading hyperlinks from RTF, DocX, HTML, or Markdown. By default, hyperlink target is written in the item tag as it is. OnReadHyperlink allows to modify the default behavior.
Post Reply