如何制作具有多个嵌套边框的按钮?
How do I make a button with multiple nested borders?
我想制作一个有这样边框的按钮
到目前为止,我的想法是将按钮放在网格中,然后在网格周围制作多个边框,但是有更简单的方法吗?
根据需要嵌套尽可能多的 Border 元素:
<Border BorderBrush="Black" BorderThickness="2" CornerRadius="6">
<Border Background="SteelBlue" BorderBrush="White"
BorderThickness="1" CornerRadius="4.5" Padding="40,6">
<TextBlock Foreground="White" Text="Text"/>
</Border>
</Border>
我想制作一个有这样边框的按钮
到目前为止,我的想法是将按钮放在网格中,然后在网格周围制作多个边框,但是有更简单的方法吗?
根据需要嵌套尽可能多的 Border 元素:
<Border BorderBrush="Black" BorderThickness="2" CornerRadius="6">
<Border Background="SteelBlue" BorderBrush="White"
BorderThickness="1" CornerRadius="4.5" Padding="40,6">
<TextBlock Foreground="White" Text="Text"/>
</Border>
</Border>