0

I'm currently using TMemo for a small paragraph of text. However I need to be able to add in a hyperlink to a download page/file in that paragraph.

Is it possible to do this with TMemo or is there any other object I can use for this purpose?

Wiliam Cardoso
  • 434
  • 1
  • 8
  • 23
  • No it is not possible to do this with `TMemo`, yes there are other components that you can use. However, recommendation questions are off topic here. – David Heffernan Jun 25 '19 at 15:56
  • 4
    It should be [possible with TRichEdit](https://stackoverflow.com/questions/42532760/adding-true-hyperlink-support-to-trichedit) or as said above some components like [SynEdit](https://github.com/SynEdit/SynEdit) with `TSynURISyn` highlighter. – Peter Wolf Jun 25 '19 at 16:00
  • @DavidHeffernan This is asking for an object (component) that can do it. Might as well be part of Delphi/VCL without OP knowing. Calling this off topic for that reason seems a bit harsh... – GolezTrol Jun 25 '19 at 20:36
  • Yes, I always use `TRichEdit` for this, and have been doing it for years. The underlying Win32 Rich Edit control has native support for hyperlinks, and it is working very well. However, since the `TRichEdit` VCL wrapper doesn't expose this functionality of the Win32 control, you need to do a small amount of coding yourself against the Win32 APIs. Personally, I have created a `TRichEdit` subclass which has a property `URLDetect`, which, if set to `True`, makes the control automatically detect hyperlinks. I didn't have to write many lines of code to make that happen. – Andreas Rejbrand Jun 27 '19 at 06:20

0 Answers0