Clicking HyperLinks in a RichTextBox without holding down CTRL - WPF

后端 未结 6 1107
鱼传尺愫
鱼传尺愫 2020-11-30 11:35

I have a WPF RichTextBox with isReadOnly set to True. I would like users to be able to click on HyperLinks contained within the RichTextBox, withou

6条回答
  •  猫巷女王i
    2020-11-30 12:00

    I found a solution. Set IsDocumentEnabled to "True" and set IsReadOnly to "True".

    
    

    Once I did this, the mouse would turn into a 'hand' when I hover over a text displayed within a HyperLink tag. Clicking without holding control will fire the 'Click' event.

    I am using WPF from .NET 4. I do not know if earlier versions of .NET do not function as I describe above.

提交回复
热议问题