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

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

本篇包括tip111-tip120  
[http://www.watch-life.net/visual-studio/visual-studio-2008-tip-day-12.html](http://www.watch-life.net/visual-studio/visual-studio-2008-tip-day-12.html)

## #111、定义最近使用的列表中显示项的数目

原文链接:[How to customize the number of items shown in the recent files lists](http://blogs.msdn.com/saraford/archive/2007/12/20/did-you-know-how-to-customize-the-number-of-items-shown-in-the-recent-files-lists-and-where-to-find-those-lists.aspx)

**操作步骤：**  
菜单：**工具+选项+环境**，在“**最近的文件**”中的“**最近使用的列表中显示项**”输入数字，比如6

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

则会在**菜单+最近的文件**，显示6个最近使用的文件。

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

显示最近打开的窗体也是类似。只要在“窗口菜单显示的项”输入数目即可。

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

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

**评论：这个技巧估计知道的人比较多**

## #112、隐藏Visual Studio 的状态栏

原文链接:[You can hide the Visual Studio status bar](http://blogs.msdn.com/saraford/archive/2007/12/21/did-you-know-you-can-hide-the-visual-studio-status-bar.aspx)

**操作步骤：**  
菜单：**工具+选项+环境+常规**，不选中“显示状态栏”

显示状态栏和不显示状态的图示  
![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Didyo.YoucanhidetheVisualStudiostatusbar_A627/StatusBarHiding_thumb.jpg)

**评论：我一般显示状态栏，有些编译信息比如是否编译成功都会显示，这样看起来比较方便。**

## #113、定制自动隐藏和关闭停靠工具窗口

原文链接: [How to customize auto-hiding and closing docked tool windows](http://blogs.msdn.com/saraford/archive/2007/12/24/did-you-know-how-to-customize-auto-hiding-and-closing-docked-tool-windows.aspx)

**操作步骤：**  
如果两个窗口处于非自动隐藏状态同时停靠在一边，通过下方的Tab标签来切换。有两有个设置可以控制它们自动隐藏和关闭窗口。  
菜单：**工具+选项+环境+常规**  
选项一：**“关闭”按钮只影响活动的窗口**（默认选择）。单击“关闭”按钮时，只关闭当前具有焦点的工具窗口，而不是停靠集中所有的工具窗口

选项二：**“自动隐藏”按钮只影响活动的窗口**（默认未选中）。单击“自动隐藏”按钮时，只自动隐藏当前具有焦点的工具窗口，而不是停靠集中所有的工具窗口

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

**评论：从这些设置体现微软在这些细节的问题上考虑还是非常仔细的。**

## #114、如果加快停靠工具窗口的滑动速度

原文链接：[You can speed up or slow down how fast a tool window slides to a from a docked position](http://blogs.msdn.com/saraford/archive/2007/12/25/did-you-know-you-can-speed-up-or-slow-down-how-fast-a-tool-window.aspx)

**操作步骤：**  
菜单：**工具+选项+环境+常规**，选中“**动画处理环境工具**”，然后“速度”的滑块来加快动画的效果。

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

当然你也可以取消动画效果。

**评论：我一般都不使用动画效果，我喜欢很快的显示**。

## #115、如何重复用相同的编辑窗体打开文件

原文链接：[How to reuse the same editor window when opening files](http://blogs.msdn.com/saraford/archive/2007/12/26/did-you-know-how-to-reuse-the-same-editor-window-when-opening-files.aspx)

**操作步骤：**  
菜单：**工具+选项+环境+文档**，选中“**重用当前文档窗口（如果已保存）**”

当你打开一篇文档编辑后，想看看文档在编辑前原文，可以使用这个方法，而不必用撤销了。

**评论：默认情况下，当打开同一个文件的时候，会自动激活已经打开的文档窗口。**

## #116、在编辑中自动刷新当前文档

原文链接：[How to automatically refresh an open document in the editor](http://blogs.msdn.com/saraford/archive/2007/12/27/did-you-know-how-to-automatically-refresh-an-open-document-in-the-editor.aspx)

**操作步骤：**  
菜单：**工具+选项+环境+文档**，选中“当文档在该环境外改变时检测”项。选中此项后，“**自动加载更改**”选项变的可用。

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

如果只选中第一项的话，文档改变的时候，就会有确认的提示：是否加载改变后的文档？

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

**评论：和作者一样，我一般也不敢启动第二项，否者文档可能无法还原**。

## #117、在vs里编辑只读文件

原文链接：[How to edit a read-only file in VS](http://blogs.msdn.com/saraford/archive/2007/12/28/did-you-know-how-to-edit-a-read-only-file-in-vs.aspx)

**操作步骤：**  
菜单：**工具+选项+环境+文档**，选中“**允许编辑只读文件，当试图保存时发出警告**“项。

如果选中了此项，在保存的时候会提示”另存“或”覆盖“

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Didyouknow.HowtoeditareadonlyfileinVS_A71C/AllowReadOnlyFileEditing2_thumb.jpg)

如果没有选中此项，在保存时会提示”**编辑内存中内容**“或”**使可写**“

![](http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/Didyouknow.HowtoeditareadonlyfileinVS_A71C/AllowReadOnlyFileEditing_thumb.jpg)

**评论：我一般选中，这样在编辑只读文档的时候，免得对文档误编辑**

## #118、如何在打开文件对话框中指定文件目录

原文链接：[How to customize what directory the File - Open - File dialog opens to](http://blogs.msdn.com/saraford/archive/2007/12/31/did-you-know-how-to-customize-what-directory-the-file-open-file-dialog-opens-to.aspx)

**操作步骤：**  
菜单：**工具+选项+环境+文档**，选中“**使用当前活动文档的目录打开文件**”项。

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

选中此项，在“打开文件”对话框默认的目录就是当前打开的文档的目录。

如果没选中此项，在“打开文件”对话框默认的目录就是上一次打开的目录。

**评论：这选项让你不必很麻烦的去找文件了，一般使用的文件都会和当前打开的文件位置靠近**

## #119、在解决方案管理器显示杂项文件

原文链接：[How to show the Miscellaneous Files Project in the Solution Explorer](http://blogs.msdn.com/saraford/archive/2008/01/01/did-you-know-how-to-show-the-miscellaneous-files-project-in-the-solution-explorer.aspx)

**操作步骤：**  
菜单：**工具+选项+环境+文档**，选中“**在解决方案管理器显示杂项文件**”项。

杂项文件是独立于项目和解决方案的文件，不包括在生成中，而且无法包括在受源代码管理的解决方案中。

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

如果你经常要查看项目或解决方案以外的文件，这个功能很有用，比如测试的用例文件或引用的dll类库。如果你想下次打开解决方案的时候，仍然看见杂项文件，可以在“**保存在杂项文件项目中的项**”填一个数字，最大可以填256.

**评论：我很喜欢这个功能，比如开发文档可以放在这里面，随时可以来查看，或者放一些源码的例子。当然，像zip或rar之类的文件，vs是无法打开的。**

## #120、改变Visual Studio 起始页的Rss源

原文链接：[You can change the RSS feed on the Visual Studio Start Page](http://blogs.msdn.com/saraford/archive/2008/01/02/did-you-know-you-can-change-the-rss-feed-on-the-visual-studio-start-page.aspx)

**操作步骤：**  
菜单：**工具+选项+环境+启动**，在“**启动时**”下拉框中“**显示起始页**”，然后在“起始页新闻频道”中输入rss源的地址。

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

同时可以设置下载内容的时间间隔。

**评论：我一般都不用这个，因为如果网络状况不好的话，加载起来比较慢**

更多文章见：守望轩\[[http://www.watch-life.net/](http://blog.csdn.net/www.watch-life.net)]