WPF 按钮内边框
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13965867/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
WPF Button Inner Border
提问by Hardik
I am new to WPF development, I am creating a button style as per my designer provided it.

我是 WPF 开发的新手,我正在根据我的设计师提供的按钮样式创建它。

While creating button, I am facing an weird problem. I am not finding way Remove button Radius. I tried "Round Corner = false", but it is removing only Right side round corners. Moreover I am not finding way how to remove Inner silver border in button. I think this issue is caused because there is a default style applied to button, (chrome style in my case).
在创建按钮时,我面临一个奇怪的问题。我没有找到删除按钮半径的方法。我试过“圆角=假”,但它只删除了右侧的圆角。此外,我没有找到如何删除按钮中的内部银色边框的方法。我认为这个问题是因为有一个应用于按钮的默认样式(在我的例子中是 chrome 样式)。


Is there any way to can I remove all round corners and Inner Border.
有什么办法可以删除所有圆角和内边框。
Thanks in anticipation.
感谢期待。
回答by Ramin
see this link http://msdn.microsoft.com/en-us/library/cc278069%28v=vs.95%29.aspx
and the<ControlTemplate TargetType="Button">
part and find this line<Border x:Name="Background" CornerRadius="3" ...
and as you gussed this is why. To change, you should use your custom style.
this linke might help you too: http://msdn.microsoft.com/en-us/magazine/cc163421.aspx
请参阅此链接http://msdn.microsoft.com/en-us/library/cc278069%28v=vs.95%29.aspx
和<ControlTemplate TargetType="Button">
部分并找到这一行<Border x:Name="Background" CornerRadius="3" ...
,正如您所猜测的那样,这就是原因。要更改,您应该使用自定义样式。
此链接也可能对您有所帮助:http: //msdn.microsoft.com/en-us/magazine/cc163421.aspx

