WPF中设置按钮的FlatStyle [英] Setting Button FlatStyle in WPF

查看:760
本文介绍了WPF中设置按钮的FlatStyle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚学习风格和控制模板WPF如何影响按钮的外观,

I have just been learning about how styles and control templates in WPF can affect the appearance of buttons,

我试图设置按钮的的FlatStyle,在资源我见过我无法找到任何东西,告诉我,我怎么能做到这一点,这是通过设定的FlatStyle Windows窗体=持平。

I'm trying to set the Button's FlatStyle, in the resources I've seen I can't find anything that tells me how I can do this, in Windows Forms this is set through FlatStyle = Flat.

一个人怎么会在WPF做到这一点?

How would one do this in WPF?

推荐答案

工具栏类定义了一个风格的让按钮的神色持平。使用它的一个例子是:

The ToolBar class defines a Style that makes Buttons look flat. An example of using it is:

<Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"/>

WPF可以让您完全restyle控制,以使它们看起来像任何你想要的,这就是为什么它没有这样一个具体的的FlatStyle 在<$ C $财产C>按钮控制。

这篇关于WPF中设置按钮的FlatStyle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆