简体   繁体   English

在Windows 10中获取标题栏文本的前景

[英]Get forecolor of text of title bar in Windows 10

I need to get the color of text of title bar in Windows 10 because I want to color some text of my form upon this color. 我需要在Windows 10中获取标题栏文本的颜色,因为我想在这种颜色上为我的表单的一些文本着色。

Because the color of windows in Windows 10 can change dynamically with the background, I need to get the text color of title bar for properly coloring my form. 因为Windows 10中的窗口颜色可以随背景动态变化,所以我需要获取标题栏的文本颜色以正确着色我的表单。 For instance, if the Windows 10 color is yellow 例如,如果Windows 10颜色为黄色

在此输入图像描述

the text is black, while if the color is blue 文字是黑色的,而如果颜色是蓝色的话

在此输入图像描述

the text is white: I want the color of the text. 文字是白色的:我想要文字的颜色。

Where can I find it? 我在哪里可以找到它?

So far I properly set only the background color of my title bar with DWMCOLORIZATIONPARAMS through ColorizationColor, but I can not find a way to get the forecolor. 到目前为止,我通过ColorizationColor正确设置了标题栏的背景颜色和DWMCOLORIZATIONPARAMS,但我找不到获得前色的方法。

I believe that the SystemColors.ActiveCaptionText should be the one you need. 我相信SystemColors.ActiveCaptionText应该是你需要的。 This changes dynamically according to the current profile. 这会根据当前配置文件动态更改。

Gets a Color structure that is the color of the text in the active window's title bar. 获取Color结构,该结构是活动窗口标题栏中文本的颜色。

Link: SystemColors.ActiveCaptionText 链接: SystemColors.ActiveCaptionText

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

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