Welcome to MSDN Blogs Sign in | Join | Help

Sara Ford's Weblog

My adventures embracing open source on CodePlex and at Microsoft

News

    • Did you know... All author proceeds go directly to sending Hurricane Katrina survivors to college.

      Microsoft Visual Studio Tips book

      Recent Entries

Did you know... You can display Guidelines in the Editor - #184

My most popular tip of all time is Guidelines.  It was one of my very first tips about Visual Studio.  You can read more about Guidelines and all of the comments (!!!) here on the original Guidelines post.

To enable Guidelines:

Warning: This requires modifying your registry, so use at your own risk.  Use only if you are comfortable modifying your registry. 

  1. Go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Text Editor  
  2. Create a String (RG_SZ) key Guides
  3. The value is in the format of RBG(x,y,z) n1,...,n13  where x,y,z are the RGB values and n is the column number. You can have at most 13 guidelines.  For example, RBG(128,0,0) 5, 20 will put a two red lines at column positions 5 and 20, as illustrated below.

Guidelines shown in red at column 5 and 20

Technorati Tags: ,
Posted: Tuesday, April 01, 2008 3:00 AM by saraford

Comments

VooDoo said:

Did you know your tips are very useful ?

# April 1, 2008 6:40 AM

Sue Hernandez said:

OK, I'll admit - I bit.  I was fooled.

Keep those tips coming!!  Thanks, and Happy April 1st!

# April 1, 2008 9:32 AM

Antonio said:

Hey! that's an evil joke!

I almost cry!!!

You don't have the right to stop the Tip of the Day, ok?

# April 1, 2008 11:16 AM

pszalapski said:

These are handy; I've set one up at 8 and one at 80, so that I can have a visual aid for where "two indents" is and one where the traditional max-width is (even though I go over it all the time).

# April 1, 2008 11:22 AM

DM said:

Hi Sara,

You've repeated the typo... "RBG(128,...

Many thanks for the tips of the day!

# April 1, 2008 8:33 PM

saraford said:

AAAAAAAAAAAAAAAARRRRRRRRRRRRRRRRRRRRRGGGGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!

I even told myself, "Sara, don't repeat the typo."

thanks DM, i've corrected the typo.  Would you believe my focus in college was computer graphics?  =)

# April 1, 2008 9:13 PM

Kelvin said:

I've put this one to good use in VS2005. I do a lot of HTML editing for my major client (a lot of Classic ASP conversions) and quite a bit of code was written by programmers, NOT web developers. Needless to say, you can tell that they though of nesting as an afterthought, not a way of life.

Anyway, the guidless at the first 5 tab stops help me to quickly match up tags and keep things properly nested. It's also good when editing JavaScript.

Thanks Sara!

# April 2, 2008 9:01 AM

Niraj Bhatt said:

Understand it is cool and pardon my ignorance but can someone tell me what can this be used for? Usually VS takes care of indentation, If the guidelines were movable like in photoshop (or other graphic packages) I could have used it for checking on start and end brackets. As they are not movable I can't remove them when they are annoying (hint hint.. someone make them movable) and usually I don't care how long my line is. Is there any usability reasons for this. Irrespective of anything it is good to know about it.

# April 2, 2008 2:13 PM

DM said:

Okay, I tried posting earlier today but I think it didn't work...

I was telling you that you would be getting away with the typo for a second time (for free) because your tips are very interesting.

But ooops, I re-read your correction and instead of correcting the typo you replicated it to "RBG(x,y,z)".

Okay, you're still getting away with that mistake, because it's you.

# April 2, 2008 9:12 PM

Steve said:

Don't you mean "gridlines", not guidelines?

Guidelines are what you give us all day... right?

# April 4, 2008 5:58 AM
New Comments to this post are disabled
Page view tracker