简体   繁体   English

在Windows 10中将1px边框颜色更改为自定义颜色而不是强调色

[英]Change 1px border color to custom color instead of accent color in Windows 10

Windows 10 draws this 1px border in the accent color around most windows including the window of our WPF app or as seen here cmd.exe : Windows 10在大多数窗口(包括WPF应用程序的窗口)或cmd.exe周围的周围,以强调色绘制此1px边框:
1px强调色

But Visual Studio (which is also WPF) has changed that to fit its status bar color: 但是Visual Studio(也是WPF)已对其进行了更改,以适应其状态栏颜色:
1px VS

We would like to do the same, but I found nothing on how we can do this for WPF. 我们想做同样的事情,但是我对于如何为WPF做到这一点一无所获。
Does anybody know how this can be done? 有人知道该怎么做吗?

I believe you would need to add a window proc function to your window and handle the WM_NCPAINT message. 我相信您将需要在窗口中添加一个窗口proc函数并处理WM_NCPAINT消息。 This is similar to what's done in this code project article: Class for drawing a flat color border though he's doing it on child controls, the principle is the same for top-level windows. 这类似于此代码项目文章中的内容:尽管该类用于在孩子控件上绘制纯色边框,但其原理与顶级窗口相同。

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

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