WPF界面按钮去除边框
按钮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”属性修改边框大小了
还没有评论,来说两句吧...