I have a RichTextBox
control on a form with some text, some of which are URLs. The DetectUrls
property is set to true
. The control properly detects my URLs (they're blue, underlined and the cursor changes to a hand when I hover them). However, when I click on them nothing happens (double-click and ctrl+click are similarly ineffective). I've set the ReadOnly
property to true
, not sure if that matters. Am I missing something obvious?
views:
263answers:
1
+1
A:
there is an event you hook up to that is fired when links are clicked on.
Hook up to that
public event LinkClickedEventHandler LinkClicked;
OnLinkClicked
dmportella
2009-10-01 16:35:38
Ahh, not sure how I missed that, it is pretty obvious. Do you know how to open the default browser with the URL that was clicked in that event?
Jason
2009-10-01 16:38:25
Try Process.Start(e.LinkText).
itsmatt
2009-10-01 16:52:01