Clicking HyperLinks in a RichTextBox without holding down CTRL - WPF

后端 未结 6 1106
鱼传尺愫
鱼传尺愫 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条回答
  •  悲哀的现实
    2020-11-30 12:07

    If you want to turn Arrow into a Hand cursor always without default system navigation, below is the approach.

    
                
                                    
                
    
    
    
    private void Hyperlink_OnMouseEnter(object sender, MouseEventArgs e)
            {
                var hyperlink = (Hyperlink)sender;
                hyperlink.ForceCursor = true;
                hyperlink.Cursor = Cursors.Hand;
            }
    

提交回复
热议问题