wpf wpf中的主窗口标题栏颜色变化

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37048287/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 13:47:37  来源:igfitidea点击:

Main Window title bar color change in wpf

wpf

提问by ankita kumari

I want the color of title bar to be changed from green to red in wpf. How can I do it??

我希望 wpf 中标题栏的颜色从绿色变为红色。我该怎么做??

Like this -

像这样 -

[

[

回答by Muds

Title bar is not a client area and hence is not available for editing as such. You can though set WindowStyle="None"and then add a custom border around your window.

标题栏不是客户区,因此不可用于编辑。您可以设置WindowStyle="None"然后在窗口周围添加自定义边框。

Make sure you add Close Maximize and Minimize buttons to it.

确保向其添加关闭最大化和最小化按钮。

And if you are using .net 4.5WindowChromecan be useful as well

如果您使用的是.net 4.5WindowChrome也很有用