zoukankan      html  css  js  c++  java
  • wp7HyperlinkButton去掉下划线

    通过自己自定义模板可以解决

    思路是把HyperlinkButton的Content属性设置为空 再定义ControlTemeplate在里面加一个TextBlock用于显示没有下滑线的文本


    <HyperlinkButton  Height="30"
                                 HorizontalAlignment="Left"
                                 Margin="100,90,0,0" 
                                 Name="hyperlinkButton2" 
                                 VerticalAlignment="Top" 
                                 Width="200" NavigateUri="/MainPage.xaml"><HyperlinkButton.Template><ControlTemplate><!-- 下面是使用添加一个文本控件方法实现把下滑线去掉--><TextBlock TextAlignment="Center">导航</TextBlock></ControlTemplate></HyperlinkButton.Template></HyperlinkButton>

    但是后面我有看到书上说这样子设置不好,因为HyperlinkButton的Content属性是object属性 所以我们就可以设置image、Panel等类型的值。

    书上提供的方法是使用ContentPresenter的Content属性来设置 因为他也是Object的类型。并且通过它还可以绑定HyperlinkButton本身的Content属性值并且没有下滑线

  • 相关阅读:
    linux sed命令详解
    SQL注入基础知识
    DC-7
    DC-6
    DC-5
    DC-4
    DC-3
    DC-2
    pentestlabs
    任意文件读取和下载
  • 原文地址:https://www.cnblogs.com/hanjun/p/2722155.html
Copyright © 2011-2022 走看看