Odeslat dotazOdeslat dotaz
 

OdpovědětHelp with hyperlinks in RichTextBox

  • 7. listopadu 2009 23:20purpleflash Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     Obsahuje kód
    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.

Odpovědi

Všechny reakce