VB.NET Rich Text Box control ( RichTextBox ) - adding custom hyperlinks

  • Thread starter Thread starter Al Findlay
  • Start date Start date
A

Al Findlay

Hello!

What I want to do is be able to set a piece of text in the rich text
box control so that it has a 'link' style. Then, whenever this piece
of text is clicked on, the LinkClicked event is raised. In other
words, I want the behaviour of a hyperlink without having to show the
full url.

Is this possible without having to manually change and detect the font
styles myself?

Thanks!

Al.
 
I'm having the same problem, and from searching groups.google.com, the short
answer seems to be "no, you can't do that." The box can only display a full
URL, not a "helper link" that hides the actual URL:

http://groups.google.com/groups?hl=...8&safe=off&selm=yKLnU0cmCHA.3108@cpmsftngxa06

http://groups.google.com/[email protected]
(conplete thread)

Apparently, this is just a limitation of the .Net RichTextBox, not the
underlying CRichEditCtrl20 control. There are some possible workarounds
that involve communicating with CRichEditCtrl20, but I haven't tried these.

http://groups.google.com/groups?hl=...8&safe=off&selm=xMNE5YooCHA.1872@cpmsftngxa06
(complete thread)

Your other options are to try a third-party RichText control, or the
LinkLabel control (which supports helper links, but not rich text or
automatic scrollbars.) Let me know if you find a better solution.

--Robert Jacobson
 
Back
Top