Sunday, August 31, 2014

Tip 1.28: What's the difference between Automatic and Default in Tools–Options–Environment–Fonts And Colors?

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

Of all the pieces of UI in Visual Studio, she thinks these two options confuse her the most. She keeps forgetting what the difference is, but at least now she has them written down for the rest of time.


She's referring to the two settings, Automatic and Default, that appear in the colors drop-down list in Fonts And Colors.



Hold on tight, because here we go with her attempt at an explanation.... Automatic means that the color is inherited from some other element. For example, consider the Foreground Color for the Display Item: Visible White Space. Automatic is black, whereas Default is blue. Automatic in this context is inherited from the operating system's Window Text.



To change the operating system's Window Text on a computer running Windows Vista, go to Control Panel\Appearance and Personalization\Personalization–Window Color And Appearance–Open Classic Appearance Properties For More Color Options, and click the Advanced button. Then select Window to change Window Text Foreground and Background, Color and Color 1 respectively.

To illustrate the point about it being inherited from some other element, I've set Window Text to use a little green, setting the foreground color to bright green and the background color to dark green. For example, the text "Window Text" is in bright green and the background is in dark green.



Let's look at Visible White Space again. Automatic is bright green (coming from the Window Text setting), and Default is still blue. If you are wondering why everything else is green, she'll explain that shortly, but first, let's take it one step at a time.



Default is what Visual Studio says the default is, which may depend on your .vssettings file you selected at first launch (for example, in the General Development Settings) or the last .vssettings file you reset to via the Tools–Import And Export Settings. You can also use the Use Default button on the Tools–Options–Environment–Fonts And Colors page to do this quick reset.

For her 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 operating system's Window Text or from what Visual Studio says the best default color is.

Okay, cool. But why did so many other elements change colors?

Plain Text 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's Window Text. And since we set Plain Text to Green, every UI element in the IDE that derives its colors from Plain Text turned to green.

Sara Aside

Finally, this is written down. So she can now forget it again. =D


Happy Programming! =)
Posted by Nils-Holger at 12:40 PM with 1014 comments.

Saturday, August 30, 2014

Tip 1.27: How to change the editor background to black

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



It's all about the simple things in life.

Go to Tools–Options–Environment–Fonts And Colors and, in Display Items, select Plain Text. Now set Item Foreground to White and Item Background to Black. And enjoy!

VSTip127

In the preceding screen shot, she set Keywords to Cyan to make the picture look pretty.

Happy Programming! =)
Posted by Nils-Holger at 12:46 PM with 439 comments.

Friday, August 29, 2014

Tip 1.26: You can bind macros to keyboard shortcuts (or, "How to quickly increase or decrease your text editor font size")

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

She wrote the accessibility macros, which were her 133-line contribution to the Visual Studio 2005 product. You'll also find them in Visual Studio 2008.


Go to Tools–Options–Environment–Keyboard and, in the Show Settings For edit box, type macro. You'll see a list of samples at the top.

There are two accessibility macros worth noting: the increase and decrease text editor font size macros.



If you are using the General Development Settings and do not want to cause any conflicts with other keyboard shortcuts, bind the increase macro to Ctrl+Alt+Shift+UpArrow and the decrease macro to Ctrl+Alt+Shift+DownArrow. Of course, you can bind them to whatever shortcut you want, but these will not conflict with General Development Settings.

Now open the editor and try out the keyboard shortcuts. Remember that you have to hold down the Ctrl+Alt+Shift keys and press the up or down arrow repeatedly to really experience the full effect. Enjoy!

Happy Programming! =)
Posted by Nils-Holger at 1:34 PM with 442 comments.