Lots of people wants to limit the number of character in one line of their code to be maximum of 80/100. This is done basically for readability. Believe me, code looks really readable if you follow the character limit for one line. Here is the way to have character guidelines in microsoft visual studio editor.
First, shut down Visual Studio if already started.Open Registry editor (start>run>regedit.exe). Browse to
[here 7.1 is used for visual studio 2003, look for 8.0 if you use vs 2005, or 9.0 for vs 2008]. Create a string value called
Set Guides to the following
Where x,y,z are the RGB values and n is the column number. You can have at most 13 guidelines. For example set the Guides value data to,
This will place a Red guideline at column numbers 80 and 100.
And now launch VS and open any text file.
Just delete the Guides keys you created above. Restart VS, and no more guidelines.
You can download following registry file and run which will do the same thing.
If you find this post useful, you might also like [this] and [this] post by me as well.
Thanks! Just what I was looking for!
Exactly what I was looking for...
Seems to be an off-by-one error. The registry must be counting on a 0-start array rather than 1-start because my lines came up at col 81 and 101.
Thanks for the info though!
Thank you for the excellent tip!
Thanks for the insight Daniel. But I think the one i posted is right. VS starts column number counting from 1.
Awesome, I definitely needed this!
Glad to hear that.
I tried this but it doesn't work. I have Visual C# 2008 Express Edition - is that the problem?
I am not sure about the Visual C# 2008 Express Edition, never tried on that. Can you try with this? HKEY_CURRENT_USER\Software\Microsoft\VCExpress\9.0\Text Editor
Yes, that worked perfectly. Thanks so much for the quick response! I should have been able to figure that out myself, but it didn't occur to me that VCS stood for Visual C# Studio.
Glad it worked for you. :D
You made my day!
I was annoyed for years with the fact the VS doesn't provide a setting to highlight print margin. Thank you sooo much for solving this issue! ;-)
Thank you so much, this is exactly what I needed.
I would appreciate more visual materials, to make your blog more attractive, but your writing style really compensates it. But there is always place for improvement
Wow, this is exactly what I needed! I was tired of guessing all the time!
Post a Comment