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.

Re: VB.NET Rich Text Box control ( RichTextBox ) - adding custom hyperlinks by Robert

Robert
Tue Sep 09 15:22:07 CDT 2003

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=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&selm=yKLnU0cmCHA.3108%40cpmsftngxa06

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&selm=Qux19.35529%24vN6.1588693%40newsfep2-win.server.ntli.net
(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=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&selm=xMNE5YooCHA.1872%40cpmsftngxa06
(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




"Al Findlay" <findlay_mill@hotmail.com> wrote in message
news:606f8267.0309090730.10a04e8a@posting.google.com...
> 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.