码迷,mamicode.com
首页 > Windows程序 > 详细

wpf button变成圆角

时间:2019-07-08 13:59:25      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:http   line   wpf   order   present   nts   lin   结果   tty   

 <Button Grid.Column="5 " Width="80" Height="40" Content="搜索" HorizontalAlignment="Center" VerticalAlignment="Center">
        <Button.Template>
          <ControlTemplate TargetType="{x:Type Button}">
            <Border BorderBrush="{TemplateBinding Control.BorderBrush}"
                    BorderThickness="0"
                    CornerRadius="33,33,33,33">
              <Border.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                  <GradientStop Offset="0.0" Color="White" />
                  <GradientStop Offset="0.5" Color="Silver" />
                  <GradientStop Offset="0.0" Color="White" />
                </LinearGradientBrush>
              </Border.Background>
              <ContentPresenter HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Content="{TemplateBinding ContentControl.Content}" />
            </Border>
          </ControlTemplate>
        </Button.Template>
      </Button>

 

结果如下

技术图片

 

wpf button变成圆角

标签:http   line   wpf   order   present   nts   lin   结果   tty   

原文地址:https://www.cnblogs.com/aijiao/p/11150392.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!