Ian Boyd
Ian Boyd

Reputation: 256671

.NET: How to get ActiveCaptionText color when window is maximized?

How do you get the ActiveCaptionText color when a window is maximized?

The color is correct when the window is restored:

alt text

But is the wrong color when the window is maximized:

alt text

How do you get the active ActionCaptionText?

Note: Same question for ActiveCaption, InactiveCaption and InactiveCaptionText.


It seems like there should be something with:

VisualStyleRenderer vs = 
   new VisualStyleRenderer(VisualStyleElement.Window.MaxCaption.Active);

label1.ForeColor = vs.GetColor(ColorProperty.TextColor);

But i can't make it work. it returns black for both Caption and MaxCaption:

alt text


References

Upvotes: 3

Views: 695

Answers (1)

Mehrdad Afshari
Mehrdad Afshari

Reputation: 421978

It's an issue with Aero theme. It ignores that color in the title bar. Try Windows classic theme.

Upvotes: 1

Related Questions