Go to content Go to navigation Go to search

Add Vertical Guides/Lines to Visual Studio 2003 and 2005

I develop on two different screens: a 1600 × 1200 external monitor and the 1440 × 1050 screen on my laptop. When working on my 1600 × 1200 monitor, I want a vertical guide/line to show me where the edge of my laptop monitor would be. This way, I can keep my lines the proper length so my code doesn’t scroll off the side when working on my laptop. I do not like vertical scrolling.

Visual Studio has an undocumented feature where you can add vertical dashed guides/lines at specific columns. Woot! (Thanks go to Sara Ford for originally describing this technique.)

And I paraphrase/quote:


  1. Shut down Visual Studio if already started.
  2. Under [HKEY_CURRENT_USER]\Software\Microsoft\VisualStudio\8.0\Text Editor1 create a string value called Guides
  3. Set Guides to RGB(x,y,z) n1,...,n13 where x,y,z are the RGB values for the guides color and n is the column number. You can have at most 13 guidelines. For example, RGB(128,128,128) 1242 will place a gray guideline at column number 124.


1. For Visual Studio 2003, the registry key would be [HKEY_CURRENT_USER]\Software\Microsoft\VisualStudio\7.1\Text Editor.

2. Yes. Those are my settings. I work with a black background, so I like the gray. Why 124? It is the width of all the monitors at work, so when I work on a wider display, I know where to cut-off my code so that other developers don’t have to scroll horizontally to read code.