Skip to content

Tip 2.6: You can display guidelines in the editor to help format your code

January 5, 2014

“Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio“, courtesy of ‘Sara Ford’

Sara Ford’s Blog

Sara Aside

The most popular tip on her blog is the one about guidelines. She thinks it is so popular because it was one of her very first tips about Microsoft Visual Studio many, many years ago. She’s had a lot of people thank her for including that tip in her blog, but when a random developer stopped her in the hallway to thank her because he wrote the feature, that took hallway conversations to a new level. He had moved to another area of Visual Studio many years before my writing the tip, so he was very excited to see his feature get some public attention. She think one of the hardest things for any developer is to spend time coding a feature that never gets into the hands of a customer.


To enable guidelines, you need to modify your registry settings. Please be aware that you use guidelines at your own risk and should do so only if you are comfortable modifying your registry settings. You will need to restart Visual Studio after modifying the registry for the changes to take effect.

Go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Text Editor.

Create a String (RG_SZ) key called Guides.

The value is in the format of RGB(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, RGB(255,0,0) 5,20 will put two red guidelines at column positions 5 and 20, as illustrated here:

Happy Programming! =)

Leave a Comment

Leave a Reply

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

You are commenting using your 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: