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

&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;

本篇包括tip91-tip100  
[http://www.watch-life.net/visual-studio/visual-studio-2008-tip-day-10.html](http://www.watch-life.net/visual-studio/visual-studio-2008-tip-day-10.html)

## #91、查找组合框的一些有趣的用法

原文链接：[How to have fun with the Find Combo Box](http://blogs.msdn.com/saraford/archive/2007/11/26/did-you-know-how-to-have-fun-with-the-find-combo-box.aspx)

**操作步骤：**  
按**Ctrl+D** 转到查找组合框  
1、输入一个数字，按 **Ctrl+G**，就会转到数字所在行，同时不弹出“转到行”的对话框。  
2、输入文件名（项目内的文件），按**Ctrl+Shift+G** ，将会打开这个文件。  
3、输入一个函数名，按**F9**，将会在函数上加一个断点。  
4、输入一个查找的文字，按**F1**，将会在帮助查找该文字。  
5、输入“**&gt; +命令**”，则可以执行该命令。

**评论：如果你细心会发现查找组合框非常有用，特别是喜欢键盘操作的程序员**。

## #92、按esc键光标转到选择文本开始位置

原文链接：[How to jump to the beginning of some selected text when hitting escape](http://blogs.msdn.com/saraford/archive/2007/11/27/did-you-know-how-to-jump-to-the-beginning-of-some-selected-text-when-hitting-escape.aspx)

**操作步骤：**  
选择一段文本后，如何让光标跳转到开始的位置，如下图所示

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

如果想让光标跳转到“selection anchor”的位置，需要做如下的设置，  
菜单：**工具+选项+文本编辑器+常规**，然后选中“按escape键后转到选择定位点”。

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

**评论：这个功能作用在于如果你想重新选择文本，不必移动鼠标，按esc就搞定了**。

## #93、利用撤销让光标跳转会最有一个插入点

原文链接:[How to use undo to jump the cursor back to the last insertion point](http://blogs.msdn.com/saraford/archive/2007/11/28/did-you-know-how-to-use-undo-to-jump-the-cursor-back-to-the-last-insertion-point.aspx)

**操作步骤：**  
默认情况下在撤销记录里是不包括光标停留的位置的。

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

那么如何才可以保留呢？  
菜单：“工具+选项+文本编辑器+常规”，选中“在撤销列表中包括插入点”。

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

**评论：没想到吧，可以利用撤销功能回退到你鼠标点击过的位置。**

## #94、Beth Massi的vs每日提示浏览器

原文链接:[Beth Massi’s Visual Studio Tip of the Day Browser](http://blogs.msdn.com/saraford/archive/2007/11/28/second-helping-beth-massi-s-visual-studio-tip-of-the-day-browser.aspx)

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/SecondHelpingBethMassisVisualStudioTipof_139C9/SaraTipOfTheDayBrowser_thumb.jpg)

**评论：此篇是介绍作者的一个同事用vb写了一个浏vs每日提示的浏览器。有兴趣的可以去这个这个地址下载：[http://code.msdn.microsoft.com/vstipoftheday/Release/ProjectReleases.aspx?ReleaseId=499](http://code.msdn.microsoft.com/vstipoftheday/Release/ProjectReleases.aspx?ReleaseId=499)**。

## #95、vs每日提示的边栏工具

原文链接:[Visual Studio Tip of the Day Windows Sidebar Gadget](http://blogs.msdn.com/saraford/archive/2007/11/28/third-helping-visual-studio-tip-of-the-day-windows-sidebar-gadget.aspx)

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/ThirdHelpingVisualStudioTipoftheDayWindo_13DFB/image_thumb.png)

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/ThirdHelpingVisualStudioTipoftheDayWindo_13DFB/image_thumb_1.png)

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/ThirdHelpingVisualStudioTipoftheDayWindo_13DFB/image_thumb_3.png)

具体的下载地址：[http://gallery.live.com/LiveItemDetail.aspx?li=9ececfa9-f0cc-4274-b321-2ec49ce2e8ff](http://gallery.live.com/LiveItemDetail.aspx?li=9ececfa9-f0cc-4274-b321-2ec49ce2e8ff)

**评论：此篇和上一篇一样，没具体介绍什么技巧，只是介绍阅读vs每日提示的工具**。

## #96、自动高亮显示分割符号

原文链接:[What does that Automatic Delimiter Highlighting option do](http://blogs.msdn.com/saraford/archive/2007/11/29/did-you-know-what-does-that-automatic-delimiter-highlighting-option-do.aspx)

**操作步骤：**  
菜单：“**工具+选项+文本编辑器+常规**”，选中“自动突出显示分隔符”。

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

效果如下图  
![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.WhatdoesAutomaticDelimiterhighlighti_BEC5/automaticDelimiterHighlighting_thumb.jpg)

你也可以修改高亮的颜色效果，方法如下  
菜单：**工具+选项+环境+颜色和字体**，在“显示项”选择“大括号匹配（突出显示）”，然后选择颜色。

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

效果如下图

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

[](http://gallery.live.com/LiveItemDetail.aspx?li=9ececfa9-f0cc-4274-b321-2ec49ce2e8ff)

**评论：这样设置后代码看起来比较清楚明晰**

## #97、如何自己定义的文件类型指定语法高亮（类型）

原文链接:[How to get syntax highlighting for a given file extension](http://blogs.msdn.com/saraford/archive/2007/11/30/did-you-know-how-to-get-syntax-highlighting-for-a-given-file-extension.aspx)

**操作步骤：**  
1、给文件指定编辑器：“工具+选项+文本编辑器+文件扩展名”，输入扩展名（比如sara），然后指定编辑器（比如c#）

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

这样扩展名为sara的文件就会用c#的编辑来编辑了，而且按c#语法来高亮显示关键字

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

也可以为没有扩展名的文件来指定编辑器，只要在上面的界面选中“将无扩展名的文件映射到”项，然后选择你需要的编辑器即可。

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

**评论：现在你可以为自己定义的文件类型来制定编辑器了。**

## #98、取消智能提示

原文链接： [How to turn off Intellisense by default](http://blogs.msdn.com/saraford/archive/2007/12/03/did-you-know-how-to-turn-off-intellisense-by-default.aspx)

**操作步骤：**  
菜单：“工具+选项+文本编辑器+所有语言+常规”，不选中“自动列出成员”和“参数信息”两项。

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Didyou.HowtoturnoffIntellisensebydefault_A30F/StatementCompletionIntellisenseLess_thumb.jpg)

这里取消的只是文本编辑器的智能提示，命令行的智能提示还保留着。

**评论：谁没事去掉提示，难道是考验自己的记忆力？**。

## #99、改变括号匹配的颜色

原文链接： [How to change the Brace Matching color](http://blogs.msdn.com/saraford/archive/2007/12/04/did-you-know-how-to-change-the-brace-matching-color.aspx)

**操作步骤：**  
菜单：“工具+选项+环境+颜色和字体”，选择“括号匹配”，然后指定“项背景色”的颜色。

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

效果如下  
![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Didyouk.HowtochangetheBraceMatchingcolor_AAAE/BraceMatching2_thumb.jpg)

**评论：如果你觉得括号的匹配颜色不够明显，可以考虑设置一下**。

## #100、通过键盘实现导航栏

原文链接： [How to reach the Navigation bar via the keyboard](http://blogs.msdn.com/saraford/archive/2007/12/05/did-you-know-how-to-reach-the-navigation-bar-via-the-keyboard.aspx)

**操作步骤：**  
**你可以使用TAB键**来实现在导航栏的控制。  
![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Did.HowtoreachtheNavigationbarviathekeyb_BA0C/NavigationBar_thumb.jpg)

如果你不想使用导航栏，操作如下  
菜单：**工具+选项+文本编辑器+所有语言+常规**，不选中“导航”。

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

**评论：这篇用处似乎不大？**