活动的标题文本颜色 - 检测改变(.NET) [英] Active Caption Text Color — detect change (in .Net)

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

问题描述

在Vista中,启用了航空,在正常模式下的窗口如下所示:

On Vista, with Aero enabled, the window in normal mode looks like this:

不过,最大化它看起来像:

But maximized it looks like:

请注意,在正常模式下的标题是黑色的,当窗口最大化它是白色的。

Notice that in normal mode the caption is black and when the window is maximized it is white.

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

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

P.S。我写了一个程序后<$ C $ 观看C> 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.

您可以选择:

  • <一个href="http://msdn.microsoft.com/en-us/library/system.windows.forms.visualstyles.visualstyleelement.window.caption.aspx"相对=nofollow> VisualStyleElement.Window.Caption.Active
  • <一个href="http://msdn.microsoft.com/en-us/library/system.windows.forms.visualstyles.visualstyleelement.window.maxcaption.aspx"相对=nofollow> VisualStyleElement.Window.MaxCaption.Active
  • 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天全站免登陆