Helpful Visual Studio tricks


This topic was spurred on by my having to create some documentation, but it is something that I will take with me when I work on my upcoming book on developing quality applications in .NET (name TBD). Rather than just hit one tip, I thought it might be useful to play with a few. I have pulled some of the tips here from Sara Ford’s book Microsoft Visual Studio Tips, although some are things I discovered over the years. ASIDE: I just love Sara, as she is one of the most enthusiastic and energetic softies (term for Microsoft employees, or is that epithet? Wink).
 
Line Numbers
I have no clue why this would be off by default. To turn on line numbers in the editor, do the following
 
Tools >> Options
Text Editor Node >> All Languages Node
In the Display (third) section, click the checkbox for line numbers (below)
 
 
Guides
This one comes from writing books and I was absolutely thrilled when I first found it. Here is the skinny. Let’s say you copy your code from the IDE into a document (developer documentation, for example). You can figure out how many characters are on a line and then set up a guide in that column. NOTE: You have to edit the registry to do this, so be careful.
 
The key to look for is HKEY_CURRENT_USERSoftwareMicrosoftVisualStudio{version number here}Text Editor where {version number here} is either 8.0 (2005) or 9.0 (2008). Add a string value called Guides and then add the value of RGB({r},{G},{B}) {place1, … placeN} with the proper placeholders fillled {}. For example, a slate grey guide a position 72 (copy to Word default length):
 
RGB(159,182,205) 72
 
You can have up to 13 guides, comma separated. As a shortcut, you can copy the "template" below and save it in a text file labeled Guildlines.reg.
 
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USERSoftwareMicrosoftVisualStudio8.0Text Editor]
"Guides"="RGB(159,182,205) 72"
 
You can then double click the file to change the registry. And, you can edit this file to make quick changes. Note that you will have to restart Visual Studio to see the changes.
 
Changing Font Size
This one may or may not be useful to you, depending on whether you do presentations and whether or not you have a zoom tool. If not, here is the skinny:
 
Tools >> Options
Environment Node >> Keyboard node
 
Search for Macros and you will see Macros.Samples.Accessibility.DecreaseTextEditorFontSize and Macros.Samples.Accessibility.IncreaseTextEditorFontSize. Select the first and then add the shortcut key Control+Shift+Alt+Down Arrow. Do the same for Increase with Control+Shift+Alt+Up Arrow. You can now increase font size rather quickly by using the up and down arrows with control+shift+alt pressed.
 
 
Number of files on lists
With larger and larger screens, and more resolution, I see only having six items in recently used lists (and perhaps only 10 items in Windows menu) as a bit short-sided. It really depends on how much code you are slinging, but if you feel the same, it is easy to change.
 
Tools >> Options
Environment Node >> General Node
Change the values in the Recent Files section.
 
Showing Start Page
In Visual Studio .NET, you simply click on Help >> Show Start Page to get it up and running again. WIth Visual Studio 2005 or later, you find it under View >> Other Windows >> Start Page. You can also customize what page you wish to start with by Going to Tools >> Options, then Environment Node >> Web Browser Node. note that the settings here, sans the home page, affect Internet Explorer, as well.
 
 
Peace and Grace,
Greg
 
 
 
 
Advertisements

2 Responses to Helpful Visual Studio tricks

  1. Kelly says:

    Good info Greg thank you.

  2. Kelly says:

    by the way did you join me on facebook yet?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: