WPF界面(xaml):按钮去除边框、修改边框厚度

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zcc9618/article/details/80882855

# 按钮Button去除边框 #

            <Button x:Name="btn3" Content="修改密码" HorizontalAlignment="Left" Margin="190,347,0,0" VerticalAlignment="Top" Width="139" Click="btn3_Click" BorderBrush="{x:Null}" FontSize="20" Foreground="#FF508CC8" BorderThickness="0"  Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">

其中 BorderThickness="0"  Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"起了效果

****************************************************************

# 按钮Button修改边框厚度无效 #

            <Button x:Name="btn2" Content="登  录" HorizontalAlignment="Left" Margin="378,199,0,0" VerticalAlignment="Top" Width="141" Click="btn2_Click" BorderBrush="White" FontSize="20" Foreground="White" BorderThickness="5,2,4,2"  Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">

先添加一句Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"

就可以通过BorderThickness="5,2,4,2"属性修改边框大小了

*****************************************************************


猜你喜欢

转载自blog.csdn.net/zcc9618/article/details/80882855