活动字幕文本颜色 - 检测更改(在.Net中) [英] Active Caption Text Color — detect change (in .Net)

查看:276
本文介绍了活动字幕文本颜色 - 检测更改(在.Net中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Vista上,启用Aero后,正常模式下的窗口标题为黑色(写在轻微的玻璃上),而在最大化时,标题为白色(写在黑色玻璃上)。

On Vista, with Aero enabled, the window's title in normal mode has text in black (written over a slightly light glass) while when maximized the title is in white (written over a dark glass).

如何确定窗口标题的当前颜色?

How can I determine the current color of the window title ?

PS我写了一个程序来观察 SystemColors.ActiveCaptionTextColor 后,但在两种模式下保持不变。

P.S. I wrote a program to watch after SystemColors.ActiveCaptionTextColor, but it remains the same in two modes.

推荐答案

我不能让VisualStyleRenderer告诉我任何东西。

i can't make VisualStyleRenderer tell me anything either.

您可以选择:

  • VisualStyleElement.Window.Caption.Active
  • VisualStyleElement.Window.MaxCaption.Active

因为 MaxCaption 最大化窗口的标题栏的每个状态提供了VisualStyleElement对象。

Because MaxCaption provides VisualStyleElement objects for each state of the title bar of a maximized window.

除了它实际上不工作。如果您要求活动最大化窗口的字幕文本颜色:

Except it doesn't actually work. If you ask for the caption text color of an active maximized window:

VisualStyleRenderer renderer = 
   new VisualStyleRenderer(VisualStyleElement.Window.MaxCaption.Active);
Color c = renderer.GetColor(ColorProperty.TextColor);

字幕会返回黑色 MaxCaption

事实上,几乎所有的颜色在两者之间是相同的:

In fact, almost all colors are the same between the two:

我的猜测是没有办法让你的应用程序具有相同的外观,感觉为操作系统。

My guess is that there's no way to make your application have the same look and feel as the operating system.

这篇关于活动字幕文本颜色 - 检测更改(在.Net中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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