Create a hyperlink in a TextBlock or RichTextBox
You can create a hyperlink inside a TextBlock or RichTextBox object that will navigate to another document in your application, or to a web page.
Create a hyperlink in a WPF project
If you are working in a Windows Presentation Foundation (WPF) project, you can create hyperlinks only in a Page document, and thus in a NavigationWindow object. (To create a new Page document, on the File menu, click New Item, and then click Page.) The linked-to topic must be either a Page document in your application or a web page.
To create a hyperlink in a TextBlock in a WPF project
In the Tools panel, click either Selection or Direct Selection.
Click to select the TextBlock object to which you want to add a hyperlink, right-click the object, and then click Edit Text.
Do one of the following:
To apply a hyperlink to existing text, drag to select the text.
To create a hyperlink from scratch, click where you want the hyperlink text to appear.
In the Properties panel, under Text, on the Font tab , click Hyperlink .
In the Create Hyperlink dialog box, enter the text that you want to be hyperlinked next to Hyperlink Text, enter the URL or URI (Universal Resource Identifier) for the link next to Hyperlink URI, and then click OK.
To create a hyperlink in a RichTextBox in a WPF project
In the Tools panel, click either Selection or Direct Selection.
Click the RichTextBox object to which you want to add a hyperlink. In the Properties panel, do the following:
In the Common Properties category, select IsDocumentEnabled.
In the Text category, select IsReadOnly.
Right-click the RichTextBox object to which you want to add a hyperlink, and then click Edit Text.
Do one of the following:
To add a hyperlink to existing text, drag to select the text.
To create a hyperlink from scratch, click where you want the hyperlink text to appear.
In the Properties panel, under Text, on the Font tab , click Hyperlink .
In the Create Hyperlink dialog box, type the text that you want to be hyperlinked next to Hyperlink Text, type the URL or URI (Universal Resource Identifier) for the link next to Hyperlink URI, and then click OK.
Create a hyperlink in a Silverlight project
If you are working in a Microsoft Silverlight project, you can create hyperlinks in all document types if you are using a RichTextBox with the IsReadOnly property set to True. However, Silverlight does not support hyperlinks in TextBlock objects.
To create a hyperlink in a RichTextBox in a Silverlight project
In the Tools panel, click either Selection or Direct Selection.
Select the RichTextBox object to which you want to add a hyperlink. In the Properties panel, in the Text category, select IsReadOnly.
Right-click the RichTextBox object to which you want to add a hyperlink, and then click Edit Text.
Do one of the following:
To apply a hyperlink to existing text, drag to select the text.
To create a hyperlink from scratch, click where you want the hyperlink text to appear.
In the Properties panel, under Text, on the Font tab , click Hyperlink .
In the Create Hyperlink dialog box, type the text that you want to be hyperlinked next to Hyperlink Text, type the URL or URI (Universal Resource Identifier) for the link next to Hyperlink URI, and then click OK.