KHW
KHW

Reputation:

Font color of disabled buttons

How do I find the exact gray color of a font when the IsEnabled property of a button is false? It appears that there are subtle differences between versions of windows, so I want to get this color from the system to ensure IsEnable colors match.

Upvotes: 3

Views: 2884

Answers (1)

ColinE
ColinE

Reputation: 70132

If you look at the control template here:

http://msdn.microsoft.com/en-us/library/ms753328.aspx

You can see that the foreground colour when the button is disabled is defined as follows:

<Color x:Key="DisabledForegroundColor">#FF888888</Color>

You should be able to look up DisabledForegroundColor (this.Resources["DisabledForegroundColor"]) from your code.

Upvotes: 1

Related Questions