Hyperlink WPF in VB.NET

This article defines how to create or use Hyperlink in WPF using XAML.
  • 4467


A hyperlink will show up as a single word or group of words that will usually be marked as underlined, and are frequently blue in color. Clicking on the hyperlink may take one to another part of the page, or it may open another Internet page or, Hyperlink is a A clickable connection that allows you to jump from one word, picture, or information object to another.

To use it within a windows-based application we need to handle the RequestNavigate event and write the code.


For example


XAML code


<Window x:Class="MainWindow"



    Title="MainWindow" Height="350" Width="525">


        <TextBlock FontSize="20"> Welcome to         

<Hyperlink NavigateUri="http://www.google.com" RequestNavigate="Hyperlink_RequestNavigate">








windows-based application we need to hanlde the RequestNavigate event and write the code.


Private Sub Hyperlink_RequestNavigate(ByVal sender As Object, ByVal e As RequestNavigateEventArgs)

        Process.Start(New ProcessStartInfo(e.Uri.AbsoluteUri))

        e.Handled = True

    End Sub


Now run the application and test it.






Now click on the link google.com and test it.






More Articles

© 2020 DotNetHeaven. All rights reserved.