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属性值并且没有下滑线

  • 相关阅读:
    Oracle数据库5--数据库对象
    Oracle数据库4--多表关联
    Session
    cookie
    Servlet的部分response响应处理
    Servlet的部分request请求处理
    Linux部分命令
    Linux基础
    弹性布局
    animation 动画
  • 原文地址:https://www.cnblogs.com/hanjun/p/2722155.html
Copyright © 2011-2022 走看看