---
title: "Visual Studio 2008 每日提示(十九)"
author: "cjc"
date: "2008-12-31T00:39:00Z"
tags: []
slug: "visual-studio-2008"
draft: false
lastmod: "2008-12-31T00:39:00Z"
id: 402668
url: "https://cjc.iteye.com/blog/402668"
---

&lt;script&gt;function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}&lt;/script&gt;

本篇包括tip181-tip190  
[http://www.watch-life.net/visual-studio/visual-studio-2008-tip-day-19.html](http://www.watch-life.net/visual-studio/visual-studio-2008-tip-day-19.html%20)

## #181、按Ctrl+Shift+F12 在错误列表查看下一个错误记录

原文链接:[You can use Ctrl+Shift+F12 to view the next Error listed in the error list](http://blogs.msdn.com/saraford/archive/2008/03/27/did-you-know-you-can-use-ctrl-shift-f12-to-view-the-next-error-listed-in-the-error-list.aspx)

**操作步骤：**  
如题，你可以按**Ctrl+Shift+F12**在错误列表定位到下一个错误记录。当然也可以输入命令：**视图.下一错误**。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.YoucanuseCtrlShiftF12toviewthenextEr_13A3C/ErrorListNextError_thumb.jpg)

同时在查看错误的时候，状态栏也会显示错误的内容。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.YoucanuseCtrlShiftF12toviewthenextEr_13A3C/ErrorListNextError2_thumb.jpg)

**评论：在作者文章里充满着大量这样用键盘快捷键来定位的操作。**

## #182、从错误列表定位到错误帮助目录

原文链接:[You can view an error's help documentation directly from the Error List](http://blogs.msdn.com/saraford/archive/2008/03/28/did-you-know-you-can-view-an-error-s-help-documentation-directly-from-the-error-list.aspx)

**操作步骤：**  
右键单击错误列表，从右键菜单选择“**显示错误帮助**”项

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.Youcanviewanerrorshelpdocumentationd_13D62/ErrorListShowErrorHelp_thumb.jpg)

此命令会启动外部帮助浏览器，并定位具体的错误

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.Youcanviewanerrorshelpdocumentationd_13D62/ErrorListShowErrorHelp2_thumb.jpg)

**评论：我想没人怀疑微软的msdn文档的价值，恐怕在这点上没那家公司出其右。**

## #183、在错误列表和任务列表，用多个方式排序

原文链接:[You can do multi-column sorting (secondary sort, etc.) in both the Error List and Task List](http://blogs.msdn.com/saraford/archive/2008/03/31/did-you-know-you-can-do-multi-column-sorting-secondary-sort-etc-in-both-the-error-list-and-task-list-183.aspx)

**操作步骤：**  
1、单击你想作为主排序的列头。  
2、按Shirt，单击作为第二排序的列头。  
3、重复第二步的操作，选择更多的列

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Didyouk.inboththeErrorListandTaskList183_CA5A/TaskListSecondarySorting_thumb_1.jpg)

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Didyouk.inboththeErrorListandTaskList183_CA5A/ErrorListSecondarySort_thumb.jpg)

**评论：排序后可以更好找到你所需的错误或任务。**

## #184、在编辑器显示基准线（Guidelines）

原文链接:Yo[u can display Guidelines in the Editor](http://blogs.msdn.com/saraford/archive/2008/04/01/did-you-know-you-can-display-guidelines-in-the-editor-and-tip-of-the-day-ends-today-184.aspx)

**操作步骤：**  
1、打开注册表编辑器，转到**HKEY\_CURRENT\_USER\\Software\\Microsoft\\VisualStudio\\9.0\\Text Editor**  
2、添加一个名为“**Guides** ”的字符串键（RG\_SZ)）  
3、键值为：**RBG(x,y,z) n1,...,n13**，x,y,z的值是RGB值，n是数字，可以最多有12条基准线。

例如： RBG(128,0,0) 5, 20 则有两根红色的基准线位于的第5和第20的位置。如下图所示

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.YoucandisplayGuidelinesintheEditoran_A117/Guidelines_thumb.jpg)

**评论：这个技巧需要修改注册表来实现。不过需要才重启vs2008才可以看见。**

## #185、在工具箱，在图标视图和列表视图两种方式切换

原文链接:[You can switch between Icon View and List Item View in the toolbox](http://blogs.msdn.com/saraford/archive/2008/04/02/did-you-know-you-can-switch-between-icon-view-and-list-item-view-in-the-toolbox-185.aspx)

**操作步骤：**  
右键单击你想选择工具组的任意位置，在右键菜单中不选中“**列表视图**”，就会切换到图标视图。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.YoucanswitchbetweenIconViewandListIt_DAC0/ToolboxListvIcon1_thumb_2.jpg)

图标视图  
![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.YoucanswitchbetweenIconViewandListIt_DAC0/ToolboxIconView_thumb.jpg)

列表视图（默认）

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.YoucanswitchbetweenIconViewandListIt_DAC0/ToolboxListvIcon_thumb.jpg)

**评论：在图标状态看起来也挺舒服的，不必拖动滚动条了。**

## #186、用“\*”展开和用“/”折叠工具箱

原文链接:[You can use '\*' to Expand All and '/' to Collapse All in the Toolbox](http://blogs.msdn.com/saraford/archive/2008/04/03/did-you-know-you-can-use-to-expand-all-and-to-collapse-all-in-the-toolbox-186.aspx)

**操作步骤：**  
可以通过按快捷键来在工具栏展开或折叠项，按“\*”展开

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.YoucanusetoExpandAllandtoCollapseAll_DF23/ToolboxAllExpanded_thumb.jpg)

按“/”折叠

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.YoucanusetoExpandAllandtoCollapseAll_DF23/ToolboxAllCollapsed_thumb.jpg)

**评论：我习惯用鼠标来操作**

## #187、在工具箱，用Ctrl+Up 和Ctrl+Down 在不同的控件组移动

原文链接:[You can use Ctrl+Up and Ctrl+Down to move among the various control groups in the Toolbox](http://blogs.msdn.com/saraford/archive/2008/04/04/did-you-know-you-can-use-ctrl-up-and-ctrl-down-to-move-among-the-various-control-groups-in-the-toolbox-187.aspx)

**操作步骤：**  
按“**Ctrl+上箭头**”向上一个控件组移动，按“**Ctrl+下箭头**”向下一个控件组移动。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.YoucanuseCtrlUpandCtrlDowntomoveamon_E208/ToolboxGroupNavigation_thumb.jpg)

**评论：这样移动还是比较方便。**

## #188、按字母顺序给给工具箱排序

原文链接:[You can sort items in the Toolbox alphabetically](http://blogs.msdn.com/saraford/archive/2008/04/07/did-you-know-you-can-sort-items-in-the-toolbox-alphabetically-188.aspx)

**操作步骤：**  
大部分时间工具箱控件是按字母排序的，不过如果你想重置的话，可以打开工具箱，右键单击，从右键菜单选择“按字母顺序排序”。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.YoucansortitemsintheToolboxalphabeti_E57F/ToolboxSortAlpha_thumb.jpg)

**评论：这功能用的比较少，一般控件都会按字母顺序排好了序。**

## #189、每个工具组都有个指针空间，它是做什么的呢？

原文链接：[Why does each Toolbox group have a Pointer control, and what does it actually do](http://blogs.msdn.com/saraford/archive/2008/04/08/did-you-know-why-does-each-toolbox-group-have-a-pointer-control-and-what-does-it-actually-do-189.aspx)  
**操作步骤：**  
在工具箱，用鼠标左键点一个控件后（鼠标处于非按下状态），把光标移到一个winform后光标就会有个“拖拽”的标志，单击后就会添加该控件。而单击前，我想放弃选择这个控件，就只要左键单击一下“指针”控件就放弃刚才的选择。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.WhydoeseachToolboxgrouphaveaPointerc_E8D7/toolboxPointer_thumb.jpg)

**评论：这个情况只是适用于winform的情形，至于webform 只能拖过左键拖拽的方式才可以添加控件。对于拖拽的方式（无论winform还是webform）如果想放弃选择的控件，只要把光标放过到“指针”控件上，松开左键即可。注意：这里的“指针”本质上不是控件。**

## #190、显示所有隐藏的控件

原文链接:[You can do a "show all" to find your "hiding" toolbox controls](http://blogs.msdn.com/saraford/archive/2008/04/09/did-you-know-you-can-do-a-show-all-to-find-your-hiding-toolbox-controls-190.aspx)

**操作步骤：**  
工具箱默认不会显示所有的控件，显示的控件是适用当前活动的编辑器的控件，无法当前活动编辑器使用的控件是默认隐藏的。另外，一些新增的控件也是不可见。如果想把隐藏的控件都显示出来。右键单击工具箱，在右键菜单选中“全部显示”项。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.Youcandoashowalltofindyourhidingtool_BBF1/ToolboxShowAll_thumb.jpg)

不过，不适用当前活动编辑的控件将显示不可用。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.Youcandoashowalltofindyourhidingtool_BBF1/ToolboxShowAll2_thumb.jpg)

**评论：对于新增的控件，这个操作有必要。**

更多文章见：守望轩\[[http://www.watch-life.net](http://www.cnblogs.com/%E6%9B%B4%E5%A4%9A%E6%96%87%E7%AB%A0%E8%A7%81%EF%BC%9A%E5%AE%88%E6%9C%9B%E8%BD%A9%5Bhttp://www.watch-life.net/%5D)/]