Hi
Perhaps simple question: how can i, from Delphi code, insert a hyperlink like
a href="https://someurl">Visit W3Schools</a>
Into the RichEdit
Thanks for anwering
Eric
Hyperlink
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Hyperlink
I assume that your question is about our components (TRichViewEdit), not about the standard TRichEdit.
Do you use RichViewActions?
If yes, the simplest way is to use TrvActionInsertHyperlink:
You need to process OnJump event to open the clicked link in browser (or perform other operation):
If you do not use RichViewActions, it would require more code (to specify hyperlink attributes), see the demo in <TRichView Dir>\TRichView\Demos\DelphiUnicode\Assorted\Hypertext\CreateHyperlink\
Do you use RichViewActions?
If yes, the simplest way is to use TrvActionInsertHyperlink:
Code: Select all
rve.CurTextStyleNo := rvActionInsertHyperlink1.GetHyperlinkStyleNo(rve);
rve.InsertStringTag('Visit W3Schools', 'https://someurl');
Code: Select all
procedure TForm3.rveJump(Sender: TObject; id: Integer);
begin
rvActionInsertHyperlink1.GoToLink(rve, id);
end;