Ask a questionAsk a question
 

AnswerHelp with hyperlinks in RichTextBox

  • Saturday, November 07, 2009 11:20 PMpurpleflash Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    I am using .Net 3.5sp1.  I have a RichTextBox and I insert text (via code) into it (it's used as part of a property grid).

                TextBoxDescription.Document.Blocks.Clear();
                TextBoxDescription.AppendText(app.GetDescription());
                TextBoxDescription.IsDocumentEnabled = true;
    
    This works fine as far as getting the text into it, but if the text happens to contain hyperlinks they aren't "recognized" as such by the control, hence the user can't use them as links (I know you need Ctrl with the click but that doesn't work).

    I think the problem is that I'm using AppendText, which probably just writes the characters to the control.  But if I copy a chunk of a web page which includes links, and paste it in, that doesn't do it either (show the links).

    What am I missing?  thanks.

Answers

All Replies