vs2008与vs2005 增加代码边界线

时间:2022-06-02 00:26:56

使用过Delphi的人对于代码边界线感觉很棒,这样的辅助功能真的很好用。现在用.net开发,却没有找到相同的功能,每次都要手动调整代码宽度,看起来也别扭。现在跟大家分享一个为vs增加列分界线的功能,是从国外网站上看到的。

原文如下:

First, shut down Visual Studio 2005 if already started.
 
Under
[HKEY_CURRENT_USER]\Software\Microsoft\VisualStudio\8.0\Text Editor
Create a string value called
Guides
 
Set Guides to the following
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,
Guides = RGB(128,0,0) 5, 80
will place a Red guideline at column numbers 5 and 80.
 
And now launch VS and open a text file.
很简单,先关闭VS2008、2005,打开注册表,找到 [HKEY_CURRENT_USER]\Software\Microsoft\VisualStudio\8.0\Text Editor,如果是2008就是 [HKEY_CURRENT_USER]\Software\Microsoft\VisualStudio\9.0\Text Editor,然后在该项下新建一个字符串键Guides,键值为RGB(x,y,z) n 1 ,...,n 13, 格式,RGB(x,y,z)是边界线的颜色,n 1 ,...,n 13 表示最多可以有13条列分界线。
例如:Guides = RGB(128,0,0) 5, 80表示第5列和80列各有一个分界线,颜色为RGB(128,0,0) 。
然后重新打开VS2008、2005,到文本编辑器中即可看到效果。
如果不想要了,或改动后软件不正常,可以删除创建的键,重新启动,一切恢复如初!