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

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Development
8.Event
9.File Directory
10.Generics
11.GUI
12.Language Basics
13.LINQ
14.Network Remote
15.Security
16.Thread
17.Windows Presentation Foundation
18.Windows System
19.XML
20.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Windows Presentation Foundation » PopupScreenshots 
Use Popup to display a hyperlink
Use Popup to display a hyperlink
     



<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

   
    
    
    
    
  
Related examples in the same category
1.Create Popup mock in XamlCreate Popup mock in Xaml
2.Close a Popup with Button clickClose a Popup with Button click
3.PopupAnimation = PopupAnimation.FadePopupAnimation = PopupAnimation.Fade
4.PopupAnimation = PopupAnimation.Scroll;PopupAnimation = PopupAnimation.Scroll;
5.PopupAnimation = PopupAnimation.Slide;PopupAnimation = PopupAnimation.Slide;
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.