CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2002
    Location
    Chicago, IL
    Posts
    255

    CRichEditCtrl and hyperlinks

    Hello all -

    I have an RTF file, and in it I've created a hyperlink that I can CTRL+Click on to navigate to that site. I now have a CRichEditCtrl in a dialog which I stream that RTF file into. The problem is now that

    1. The entire URL shows up in the CRichEditCtrl, where as in the RTF file itself, only the text is a hyperlink.

    2. When I move the mouse over the hyperlink in the CRichEditCtrl, the cursor doesn't change and you can't seem to click the link to navigate to the location. The text and the link url are blue and underlined like normal links, but you can't click on it.

    Do I need to do something else with my CRichEditCtrl to allow it to recognize links and allow the user to click on them? I tried setting SetAutoURLDetect, but that seems to have no effect. Thanks in advance for any input!

  2. #2
    Join Date
    Mar 2002
    Location
    Chicago, IL
    Posts
    255

    Re: CRichEditCtrl and hyperlinks

    OK, I've partially solved my own problem. Turns out that I need to call SetAutoURLDetect to TRUE and SetEventMask to ENM_LINK *before* calling StreamIn to stream the RTF file from disk. Now that just leaves my first question. When I open the RTF file in MS Word, the text that I want to be a link is underlined and blue, but the actual hyperlink is hidden beneath the text. When I load it into my CRichEditCtrl, the actual hyperlink shows up next to the text in angle brackets. Is there a way to hide this?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured