Did you know… What the difference between “Automatic” and “Default” is in the Tools – Options – Environment – Fonts and Colors? – #230

Of all the pieces of UI in Visual Studio, I think these two options confuse me the most.   I keep forgetting what the difference is, but at least now, I have them written down for the rest of time, Internet-willing.

I’m referring to these two settings (Automatic and Default) in Fonts and Colors when you choose a color.

FontsAndColorsDefaultAutomatic

Hold on tight, because here we go…

Automatic means that the color is inherited from some other element.  For example, consider the Display Item: Visible White Space Foreground Color.  Note how Automatic is black whereas Default is blue.  The Automatic in this context inherited from the Operating System’s Window Text Foreground. 

Visible White Space Automatic vs Default

To change the OS Window Text, on a Windows Vista machine, go to Control Panel\Appearance and Personalization\Personalization – Window Color and Appearance – Open classic appearance properties for more color options, and press the Advanced button.  Then select "Window" to change the Window Text Foreground and Background.  I don’t recall exactly how to get here on an XP machine, but it’s in the general ballpark of steps.

To illustrate the point about it being inherited from some other element, I’ve set the Window Text to use a little green (yes, CodePlex is having a subliminal effect on me.) 

Operating System Window Text color option

Let’s look at the Visible White Space again.  The Automatic is bright green (coming from the Window Text Foreground) and the Default is still Blue.  (if you are wondering why everything else is green, i’ll explain that below, but one step at a time).

FontsAndColorsDefaultAutomatic5

Default is what Visual Studio says the default is, which may depend on your .vssettings file you either selected at first launch (e.g. General Development Settings) or the last .vssettings file you reset to via Tools – Import / Export settings.  You can also use the Use Default above to do this quick reset. 

For my configuration and probably for all the .vssettings files, Visible White Space has a Default color of “blue.”  It’s up to you whether you want to have it come from the OS Window Text or come from what VS says the best default color is.

Okay, Cool, but why did so many other elements change colors?

Plain Text, among others, is interesting because its Default is set to Automatic.  This is why whenever you try to set it to automatic, it shows default the next time you bring up the UI.  In other words, think of Plain Text as always coming from the operating system window text, hence why Automatic and Default are the same color in the picture below.  And since we set Plain Text to Green and more Green, every UI element in the IDE that derives its colors from Plain Text turned to Green, as also shown in the picture below.

Finally, this is written down, so I can forget it again.  =D

Technorati Tags: VS2005Tip,VS2008Tip