February 2013
Beginner to intermediate
68 pages
1h 50m
English
Unfortunately, WPF doesn’t offer a native implementation of the LinkLabel control, as Windows Forms does—but creating one is an easy task. The base is a Label control, in which the context is not plain text but rather a Hyperlink control. The following example demonstrates how to create a label that points to my blog:
<Label Width="150" Height="30"> <Hyperlink NavigateUri= "http://community.visual-basic.it/AlessandroEnglish" Hyperlink.RequestNavigate= "Hyperlink_RequestNavigate"> <TextBlock Text="Alessandro Del Sole" /> </Hyperlink></Label>
The text shown in the hyperlink is contained inside a TextBlock control and its Text property. The NavigateUri property contains the web address associated to the ...