zoukankan      html  css  js  c++  java
  • WPF超级链接

    一、添加样式

    <Style x:Key="LinkLabelStyle">   
    <Setter Property="Control.Padding" Value="0" />
    <Setter Property="Control.VerticalAlignment" Value="Center" />
    </Style>
    二、Xaml标记
    <Label Canvas.Left="29"  Canvas.Top="320" x:Name="productLink" x:Uid="productLink" Style="{StaticResource LinkLabelStyle}" >    
    <Label.Content>
    <Hyperlink x:Name="hyperlink" x:Uid="hyperlink" NavigateUri="http://www.mtdzsp.com" Style="{StaticResource LinkLabelStyle}" Hyperlink.RequestNavigate="hyperlink_RequestNavigate">
    <TextBlock Text="更多" Foreground="Black"/>
    </Hyperlink>
    </Label.Content>
    </Label>


    三、代码

         private void hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
            {
                if (e.Uri != null && string.IsNullOrEmpty(e.Uri.OriginalString) == false)
                {
                    string uri = e.Uri.AbsoluteUri;
                    Process.Start(new ProcessStartInfo(uri));
                    e.Handled = true;
                  
                }
            }
  • 相关阅读:
    TPLINK TLWR710N设置详解
    hehe.....
    AS3写FTP登录过程
    QQ
    网页设计标准尺寸:
    女孩,你愿意做他的第几个女朋友
    監聽一個變量的值變化
    dispatchEvent
    10
    C#常用代码
  • 原文地址:https://www.cnblogs.com/OnlyVersion/p/4018344.html
Copyright © 2011-2022 走看看