Use Popup to display a hyperlink : Popup « Windows Presentation Foundation « VB.Net Tutorial






<Window x:Class="ClassicControls.PopupTest"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="PopupTest" Height="300" Width="300">
    <Grid Margin="10">
      <TextBlock TextWrapping="Wrap">text 
         <Run TextDecorations="Underline" MouseEnter="run_MouseEnter">link</Run>
      </TextBlock>
      <Popup Name="popLink" StaysOpen="False" Placement="Mouse" MaxWidth="200" PopupAnimation="Slide" AllowsTransparency = "True">
        <Border BorderBrush="Beige" BorderThickness="2" Background="White">
          <TextBlock Margin="10"  TextWrapping="Wrap" >
            check out
            <Hyperlink NavigateUri="http://java2s.com" Click="lnk_Click">java2s.com</Hyperlink>
          </TextBlock>
        </Border>
      </Popup>
    </Grid>
</Window>
//File:Window.xaml.vb

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Imports System.Windows.Shapes
Imports System.Diagnostics

Namespace ClassicControls
  Public Partial Class PopupTest
    Inherits System.Windows.Window

    Public Sub New()
      InitializeComponent()
    End Sub

    Private Sub run_MouseEnter(sender As Object, e As MouseEventArgs)
      popLink.IsOpen = True
    End Sub
    Private Sub lnk_Click(sender As Object, e As RoutedEventArgs)
      Process.Start(DirectCast(sender, Hyperlink).NavigateUri.ToString())
    End Sub
  End Class
End Namespace
WPF Use Popup To Display A Hyperlink








16.19.Popup
16.19.1.Create Popup mock in XamlCreate Popup mock in Xaml
16.19.2.Close a Popup with Button clickClose a Popup with Button click
16.19.3.PopupAnimation = PopupAnimation.FadePopupAnimation = PopupAnimation.Fade
16.19.4.PopupAnimation = PopupAnimation.Scroll;PopupAnimation = PopupAnimation.Scroll;
16.19.5.PopupAnimation = PopupAnimation.Slide;PopupAnimation = PopupAnimation.Slide;
16.19.6.Use Popup to display a hyperlinkUse Popup to display a hyperlink