ReadOnly Hyperlink in a WPF RichTextBox FlowDocument


  • Hi..

    I am currently developing an application in WPF which uses a RichTextBox control to display rich reports. The report may contain hyperlinks which I use to launch a popup control. I succeeded in adding hyperlink into FlowDocument and then show and click it launch the popup. Then in found that the hyperlink control is editable. I want this hyperlink control to be ReadOnly and not deletable while the rest of the document remain editable. I didn't find any property like IsEditable/IsReadOnly or whatever. But I want this to be done so that the user can click on the link to launch the popup and enter information there and close it. If someone has a solution, kindly share it. Thanks in advance

    Thanks and Regards...

    Ananthan Unni.H.S


    Wednesday, March 28, 2012 5:48 AM

All replies

  • EDIT:

    I managed to make the Hyperlink control not editable by putting the code as below.

    Hyperlink link = new Hyperlink(new InlineUIContainer(new TextBlock(new Run("[Options]"))));
    But still this hyperlink is deletable. Any idea how to prevent it from getting deleted?


    Wednesday, March 28, 2012 6:34 AM