[英]How Can I Get This Border?
How can i get that cool border in Done Button? 如何在“完成按钮”中获得该边框? Winforms/WPF doesn't matter.
Winforms / WPF无关紧要。
I think i need gradient brush but I don't know how to use it like the above one. 我想我需要渐变笔刷,但我不知道如何像上面那样使用它。
EDIT: Now it looks so cool with this one (of course With Jim's help): 编辑:现在看起来很酷(当然有吉姆的帮助):
<Button x:Name="Button1" Height="40" Width="120" BorderThickness="2" Background="#FF262628" Foreground="White">
<Button.BorderBrush>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1" >
<GradientStop Color="#AD9974" Offset="0" />
<GradientStop Color="#533D25" Offset="1" />
<GradientStop Color="#675A37" Offset="2"/>
<GradientStop Color="#795B1F" Offset="3"/>
</LinearGradientBrush>
</Button.BorderBrush>
DONE
</Button>
With XAML you can do that with the Button.Borderbrush
and LinearGradientBrush
使用XAML,您可以使用
Button.Borderbrush
和LinearGradientBrush
做到这Button.Borderbrush
eg 例如
<Button x:Name="Button1" Height="40" Width="120" BorderThickness="2">
<Button.BorderBrush>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1" >
<GradientStop Color="#d0b175" Offset="0" />
<GradientStop Color="#624c23" Offset="1.0" />
</LinearGradientBrush>
</Button.BorderBrush>
DONE
</Button>
You can add more colors in the gradient if you have to: 如果需要,您可以在渐变中添加更多颜色:
<GradientStop Color="#d0b175" Offset="0" />
<GradientStop Color="White" Offset="0.5" />
<GradientStop Color="#624c23" Offset="1.0" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.