简体   繁体   English

在整个应用程序中更改FocusVisualStyle

[英]Change the FocusVisualStyle in the entire application

While making a WPF application I would like to change the default FocusVisualStyle (the black "marching ants" border) to something else, like for example a blue border. 在制作WPF应用程序时,我想将默认的FocusVisualStyle(黑色的“行军蚁”边框)更改为其他内容,例如蓝色边框。 I would like to make this change for every control on the entire application. 我想对整个应用程序中的每个控件进行此更改。 Is there an easier way then changing the default style for every type of control? 有没有一种简单的方法可以更改每种控件的默认样式?

Thanks 谢谢

Unfortunately there's no easy way to apply a style to all controls. 不幸的是,没有简单的方法可以将样式应用于所有控件。 The main issue is that by default WPF only allows one style per control. 主要问题在于,默认情况下,WPF仅允许每个控件使用一种样式。

You can get around this, but it requires redefining the styles of all the controls anyway. 您可以解决此问题,但是无论如何它都需要重新定义所有控件的样式。

See this question for more info: How to apply multiple styles in WPF 有关更多信息,请参见此问题: 如何在WPF中应用多种样式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM