Home Page Icon
Home Page
Table of Contents for
Cover
Close
Cover
by Sara Ford
Microsoft® Visual Studio® Tips
Microsoft® Visual Studio® Tips
SPECIAL OFFER: Upgrade this ebook with O’Reilly
Praise for Microsoft Visual Studio Tips . . .
Foreword
Introduction
How This Book Happened
Who This Book Is For
How This Book Is Organized
System Requirements
Contact the Author
Support for This Book
Tip 0.0: How to Look Up, Change, or Create Visual Studio Keyboard Shortcuts
What Will This Keyboard Shortcut Do?
What Is the Keyboard Shortcut for This Command?
How to Create or Change a Keyboard Shortcut
Where Are the Keyboard Shortcut Reference Posters?
Acknowledgements
1. Get Back to Basics with Your Editor
Basic Editing
Text Editing
Tip 1.1: How to not accidentally copy a blank line
Tip 1.2: How to cycle through the Clipboard ring to paste different things
Tip 1.3: You can use Ctrl+Enter to insert a line above and Ctrl+Shift+Enter to insert a line below
Tip 1.4: You can use Ctrl+W to select the current word
Tip 1.5: You can use Ctrl+Delete to delete the next word and Ctrl+Backspace to delete the preceding word
Tip 1.6: You can use Ctrl+L to cut the current line and Ctrl+Shift+L to delete the current line
Tip 1.7: How to delete horizontal white space at the beginning of a line
Tip 1.8: You can drag code or text to a new location
Tip 1.9: You can right-drag code to Move Here or Copy Here
Tip 1.10: How to transpose characters, words, and lines in the editor
Tip 1.11: You can use a keyboard shortcut to uppercase or lowercase a word in the editor
Undo/Redo
Tip 1.12: How to use the Undo stack on the standard toolbar
Scrolling and Navigation
Scrolling
Tip 1.13: How to use the mouse wheel for scrolling in all directions
Tip 1.14: How to jump to the top or bottom of the current view in the editor without scrolling
Tip 1.15: You can hide the vertical and horizontal scroll bars in the editor
Navigating Within and Among Editors
Tip 1.16: How to navigate forward and backward in the editor all because of go-back markers
Tip 1.17: How to use Undo to jump the cursor back to the last insertion point
Tip 1.18: How to reach the navigation bar via the keyboard
Tip 1.19: How to split a window and create new windows
Tip 1.20: You can use F6 to jump between split panes in the editor
Tip 1.21: How to enable URL navigation within the editor
Tip 1.22: How to use Ctrl+G without the Go To Line dialog box popping up
Word Wrap versus Virtual Space
Tip 1.23: How to enable word wrap
Tip 1.24: How to enable virtual space
Editor Fonts and Colors
Font Size
Tip 1.25: How to increase the editor’s ToolTip font size
Tip 1.26: You can bind macros to keyboard shortcuts (or, "How to quickly increase or decrease your text editor font size")
Fonts and Colors
Tip 1.27: How to change the editor background to black
Tip 1.28: What’s the difference between Automatic and Default in Tools–Options–Environment–Fonts And Colors?
Tip 1.29: How to change a bookmark color
Visual Cues
Tip 1.30: How to track changes in the editor
Tip 1.31: How to show line numbers in the editor
Tip 1.32: How to view visible white Space
Printing
Printing Options
Tip 1.33: How to print line numbers
Tip 1.34: How to print boldly
Tip 1.35: How to print the file path as the page header
Status Bar
Status Bar Options
Tip 1.36: You can hide the status bar
2. Make Your Editor Work for You
Advanced Editing
Selection
Tip 2.1: How to use box/column selection in the editor
Tip 2.2: How to jump to the beginning of some selected text when hitting escape
Tip 2.3: You can use Ctrl+= to select code from the current cursor location to the last go-back marker
Tip 2.4: How to swap the current anchor position in the editor
Commenting
Tip 2.5: How to quickly comment and uncomment code using keyboard shortcuts
Formatting
Tip 2.6: You can display guidelines in the editor to help format your code
Tip 2.7: How to format the document, the selected text, or just the current line
Tip 2.8: How to keep tabs or to insert spaces
Tip 2.9: How to convert spaces to tabs and tabs to spaces
Tip 2.10: You can increase and decrease the line indent from the text editor toolbar
Tip 2.11: What’s the difference between smart indenting and block indenting?
Outlining
Tip 2.12: How to collapse and expand code
Tip 2.13: You can cut and paste a collapsed block of code
Tip 2.14: You can hide outlining (selection margin) without turning off outlining
Emulations
Tip 2.15: How to enable Emacs and Brief editor emulations
Binary Editor
Tip 2.16: How to open something in the binary editor
Delimiter Highlighting and Brace Matching
Tip 2.17: What does that Automatic Delimiter Highlighting option do?
Tip 2.18: How to change the Brace Matching color
Clean up unused code
Tip 2.19: You can remove unused using statements
AutoRecover
Tip 2.20: What does Visual Studio do to autorecover files in the case of an unexpected shutdown?
File Extensions
Tip 2.21: How to get syntax highlighting for a given file extension
Opening Files
Opening Files and Editor Windows
Tip 2.22: How to reuse the same editor window when opening files
Tip 2.23: How to automatically refresh an open document in the editor
Tip 2.24: How to edit a read-only file in Visual Studio
Tip 2.25: How to customize what directory the File–Open–File dialog box opens to
Tip 2.26: How to customize the number of items shown in the Recent Files lists (and where to find those lists)
Bookmarks
Managing Bookmarks
Tip 2.27: How to set bookmarks and navigate among them
Tip 2.28: How to navigate among bookmark folders in the Bookmark window
Tip 2.29: You can bookmark all of your Quick Find results
IntelliSense
Statement Completion, Parameter Info, and Complete Word
Tip 2.30: You can use Ctrl+J to invoke statement completion
Tip 2.31: How to display parameter info for a function
Tip 2.32: How to display quick info for a function
Tip 2.33: How to complete a word
Tip 2.34: How to increase the statement completion font size
Tip 2.35: You can resize the statement completion dialog box
Tip 2.36: You can toggle between the Common and All Statement Completion tabs via the keyboard
Tip 2.37: How to turn off IntelliSense by default
Code Snippets
Using Code Snippets
Tip 2.38: You can use Ctrl+K, Ctrl+X to insert a code snippet
Tip 2.39: You can insert a code snippet via its shortcut keyword
Tip 2.40: You can insert a snippet by pressing Tab Tab
Tip 2.41: How to browse code snippets and add new ones
Tip 2.42: How to change default values and variables in a code snippet
Tip 2.43: How to share code snippets with your team
Tip 2.44: How to insert a code snippet around a block of code
3. Find What You Are Searching For
Searches from the Keyboard
Incremental Search
Tip 3.1: How to behold the power of incremental search
Current Word Searches
Tip 3.2: You can use Ctrl+F3 to search for the currently-selected word without bringing up the Find And Replace window
Tip 3.3: How to not automatically search for the currently-selected word
Repeat Last Search
Tip 3.4: You can use F3 to search for the last thing you searched for
Quick Searches
Quick Find
Tip 3.5: You can use Ctrl+F to use Quick Find in the current document
Tip 3.6: How to use the Find combo box to do a Quick Find in the current document
Tip 3.7: How to customize the Find combo box (Ctrl+D) search
Quick Replace
Tip 3.8: You can use Ctrl+H to bring up the Quick Replace window
Tip 3.9: How to hide the Quick Find/Quick Replace window after the first search hit
Quick Symbol
Tip 3.10: How to search for a symbol
Tip 3.11: You can use Shift+Alt+F12 to use Find Symbol
Find In Files Searches
Find In Files
Tip 3.12: How to find in files
Tip 3.13: You can customize what files to find in
Tip 3.14: You can stop a Find In Files search
Tip 3.15: You can replace all search string occurrences in files
Find And Replace
Tip 3.16: How to dock the Find And Replace window
Find Results Window
Tip 3.17: You can use F8 to navigate the Find Results window
Tip 3.18: How to show and hide find messages
Tip 3.19: How to browse Find Symbol results
Other Search Options
Hidden Text
Tip 3.20: How to search hidden text in the editor
Search Scope
Tip 3.21: How to search within the current project or entire solution
Regular Expressions
Tip 3.22: How to use wildcards and regular expressions while searching
4. Manage Your Environment Layout
Document Windows
File Tab Channel
Tip 4.1: You can use Ctrl+Alt+Down Arrow to drop down the file tab channel file menu
Tip 4.2: You can use Close All But This on files in the file tab channel
Tip 4.3: You can copy a file’s full path from the file tab channel
Tip 4.4: You can open a Windows Explorer browser directly to the active file
Tip 4.5: How to close just the selected files you want
Tip 4.6: Under what condition does the file tab channel drop-down button change its icon?
IDE Navigator
Tip 4.7: You can use Ctrl+Tab to bring up the IDE Navigator to get a bird’s-eye view of and navigate all open files and tool windows
Tip 4.8: How to disable the IDE Navigator
Keyboard Navigation
Tip 4.9: You can use Ctrl+F6 and Ctrl+Shift+F6 to navigate among opened document windows
Tip 4.10: You can use Ctrl+F4 to close the current document opened in the editor
MDI Mode
Tip 4.11: How to enter MDI mode
Tip 4.12: How to show the Tile Horizontally and Tile Vertically buttons in the Window Windows dialog box
Tool Windows
Dockable State
Tip 4.13: You can choose from nine IDE tool window docking targets
Tip 4.14: How to undock only a single tool window from a group
Tip 4.15: You can dock a tool window to the top of the IDE
Tip 4.16: You can use docking targets to dock tool windows in new and crazy ways
Autohiding State
Tip 4.17: You can autohide all of your tool windows with one command
Tip 4.18: You can customize how pressing a tool window push pin autohides the tool window or tool window tab group
Tip 4.19: You can show autohiding tool windows via the tool window autohide channel
Tip 4.20: You can double-click the tool window title bar to redock the tool window
Tip 4.21: You can use Shift+Click to automatically dock an autohiding tool window
Tip 4.22: You can speed up or slow down how fast a tool window slides out from a docked position
Floating State
Tip 4.23: Why would you want to make a tool window float?
Tabbed Document State
Tip 4.24: How to use Tabbed Document to maximize a tool window
Keyboard Navigation
Tip 4.25: You can use Alt+F7 and Alt+Shift+F7 to move to the next and previous tool windows
Tip 4.26: You can use Alt+F6 and Alt+Shift+F6 to cycle through opened tool windows
Tip 4.27: How to use Ctrl+Page Up and Ctrl+Page Down to navigate among all the tool windows in a tool window group
Hide State
Tip 4.28: How to customize what clicking the X button does to a tool window or tool window tab group
Hidden Keyboard Shortcuts
Tip 4.29: How to drag a tool window around using the keyboard
Tip 4.30: How to resize a tool window from the keyboard
Tip 4.31: How to access a toolbar within a tool window
Tip 4.32: You can use Shift+Esc to close a tool window
Window Layouts
Four Window Layouts
Tip 4.33: You can export just your window layouts
Tip 4.34: How to quickly access Full Screen mode
Tip 4.35: How to access a file window layout mode that you can customize
Toolbars and Context Menus
Toolbars
Tip 4.36: You can make a toolbar float
Tip 4.37: You can hide or show the default buttons from any toolbar
Tip 4.38: How to display any toolbar at any time
Tip 4.39: You can switch and swap buttons on the toolbars while the Tools–Customize dialog box is showing
Tip 4.40: You can show shortcut keys in toolbar ToolTips
Context Menus
Tip 4.41: You can customize the commands on the context menus
5. Discover More Tools for Your Design Time, Part 1
Tool Windows
Command Window
Tip 5.1: You can run Visual Studio commands from the Command Window
Tip 5.2: How to search from the Command Window
Tip 5.3: How to log your Command Window session
Tip 5.4: How to run external executables from the Command Window
Tip 5.5: How to create a command alias
Output Window
Tip 5.6: You can use F8 and Shift+F8 to navigate among errors in the Output window
Tip 5.7: You can double-click messages in the Output window to jump to that location in the code
Tip 5.8: You can use the keyboard to jump to various panes within the Output window
Tip 5.9: How to stop the Output window from showing itself during a build
Tip 5.10: You can enable word wrap in the Output window
Tip 5.11: You can customize the color scheme in the Output window
Tip 5.12: You can redirect debug messages to the Output window
Tip 5.13: You cannot enable Stop Search on the Output window
Toolbox
Tip 5.14: You can drag and drop code onto the Toolbox’s General tab
Tip 5.15: Why does each Toolbox group have a Pointer control?
Tip 5.16: How to stop the Toolbox from autopopulating with items found in the solution
Tip 5.17: You can use * to expand all and / to collapse all in the Toolbox
Tip 5.18: You can use Ctrl+Up Arrow and Ctrl+Down Arrow to move among the various control groups in the Toolbox
Tip 5.19: You can sort items in the Toolbox alphabetically
Tip 5.20: You can switch between the Icon view and List Item view in the Toolbox
Tip 5.21: You can use Show All to find your hiding Toolbox controls
Tip 5.22: You can use Ctrl+C to copy controls in a Toolbox tab and then use Ctrl+V to paste the controls into another Toolbox tab
Tip 5.23: You can create new Toolbox tabs
Task List
Tip 5.24: You can use the Task List to create user tasks that are separate from your code
Tip 5.25: You can assign a priority to your Task List’s user tasks
Tip 5.26: How to create and view TODO comments in the Task List
Tip 5.27: You can create shortcuts in your Task List
Tip 5.28: You can show HACK, UNDONE, and custom tokens in the Task List
Tip 5.29: How to disable the prompt for deleting the Task List’s user tasks
Tip 5.30: You can show a full file path in the Task List
Tip 5.31: You can create keyboard shortcuts to navigate among the various Task List categories (by using View.NextTask and View.PreviousTask)
Object Browser
Tip 5.32: You can use Ctrl+Alt+J to open the Object Browser window
Tip 5.33: You can specify to show components in your solution only in the Object Browser
Tip 5.34: You can create a custom list of components for the Object Browser
Tip 5.35: You can add references to your solution directly from the Object Browser
Tip 5.36: How to use navigate forward and back in the Object Browser
Tip 5.37: You can create a keyboard shortcut for adding references to a solution from the Object Browser
Tip 5.38: You can customize both your Object pane and Members pane in the Object Browser
Tip 5.39: You can choose whether to show base types in the Object Browser
Tip 5.40: You can hide or show hidden members and types in the Object Browser
Tip 5.41: You can mark methods and types as Hidden so that they don’t appear in Microsoft IntelliSense or in the Object Browser
Tip 5.42: What does Other mean in Show Other Members in Object Browser Settings?
Tip 5.43: How to stop displaying all inherited members in the Object Browser Member pane
Tip 5.44: You can show extension methods in the Object Browser
Tip 5.45: What are the two primary means of searching for objects in the Object Browser?
Tip 5.46: You can use F12 in the Object Browser to go to the definition of whatever is selected
Tip 5.47: You can use a Find Symbol search (Shift+F12) in the Object Browser
Tip 5.48: How to use type-ahead selection support in the Object Browser
Tip 5.49: You can export all your Object Browser customizations in a .vssettings file
Tip 5.50: Why the Object Browser has so many commands you can bind to (and how to create a keyboard shortcut to clear the search results)
Tip 5.51: You can use the View.Forward (Alt+Right Arrow) and View.Backward (Alt+Left Arrow) global commands in the Object Browser
6. Discover More Tools for Your Design Time, Part 2
Dialog Boxes
Import And Export Settings
Tip 6.1: How to find what development settings you last reset to
Tip 6.2: How to reset your environment settings via Tools–Import And Export Settings
Tip 6.3: What settings are contained in the New Project Dialog Preferred Language category
Tip 6.4: You can add your own files to the Import And Export Settings–Reset page list
Tip 6.5: What’s the difference between resetting settings and importing settings?
Tip 6.6: You can save your current settings prior to doing an Import or Reset
Tip 6.7: How Visual Studio automatically saves all your current settings every time you close it
Tip 6.8: You can copy the full file path from the final wizard page when exporting settings
Tip 6.9: You can use team settings to keep Visual Studio settings on different machines in sync
External Tools
Tip 6.10: You can run external tools from the IDE
Tip 6.11: You can add your own external tools to the list
Tip 6.12: You can rearrange the list of external tools and create mnemonics
Tip 6.13: You can have your external tool’s text displayed in the Output window
Tip 6.14: How the external tools tokens work
Tip 6.15: You can prompt for arguments when you run an external tool
Find Combo Box
Find Combo Box Runs Commands
Tip 6.16: How to have fun with the Find combo box
Tip 6.17: You can press Ctrl+/ to run Visual Studio commands in the Find combo box
Tip 6.18: How to open a file in the solution without using either a tool window or a dialog box
Tip 6.19: You can set a breakpoint on a function from the Find combo box
Start Page
Start Page Window
Tip 6.20: You can change the RSS feed on the Visual Studio Start Page
Tip 6.21: How to customize what Visual Studio opens to (or how to make the Start Page not show up when Visual Studio opens)
7. Know Your Solutions, and Other Project and Debugging Tweaks
Project and Solution System
Multitargeting
Tip 7.1: How Visual Studio 2008 supports multitargeting of the .NET Framework
Projects
Tip 7.2: How to change the default new-project location
Tip 7.3: You can toggle between small icons and large icons in the New Project dialog box
Tip 7.4: You can use solution folders to hide projects
Tip 7.5: You can create temp or "throw away" projects
Tip 7.6: How to hide or show the Project Location Is Not Trusted message box
Build Configurations
Tip 7.7: How to use Simplified Build Configurations
Solution Explorer
Tip 7.8: How to show the Miscellaneous Files project in the Solution Explorer
Tip 7.9: There is type-ahead selection support in the Solution Explorer
Tip 7.10: You can add a solution to a solution
Tip 7.11: You can automatically perform a rename within an entire project when you rename a file in the Solution Explorer
Tip 7.12: How to hide or show a solution in the Solution Explorer
Tip 7.13: How to have the Solution Explorer always show (or not show) the file currently opened in the editor
Debugging
Tracepoints
Tip 7.14: You can use tracepoints to log PrintF() or Console.WriteLine() info without editing your code
Breakpoints
Tip 7.15: You can set a breakpoint by clicking the indicator margin
Tip 7.16: You can press F9 to set a breakpoint on the current line
Tip 7.17: You can use Ctrl+F9 to enable or disable a breakpoint
Tip 7.18: You can set conditional breakpoints
Tip 7.19: You can use breakpoint filters to break the right process
Tip 7.20: You can press Ctrl+B to set a breakpoint at the desired function
Tip 7.21: You can press Ctrl+Alt+B to open the Breakpoints window
Tip 7.22: You can press Ctrl+Shift+F9 to delete all breakpoints
Tip 7.23: You can disable the warning message before you delete all breakpoints
DataTips
Tip 7.24: You can use DataTips to edit a variable’s content
Multiple Projects
Tip 7.25: How to select the startup project from the Solution Explorer
Tip 7.26: You can start debugging multiple projects
Tip 7.27: How to have all processes break when one process breaks
Compiling and Debugging Windows
Error List
Tip 7.28: You can use Ctrl+Shift+F12 to view the next error listed in the Error List
Tip 7.29: How to customize your Error List view
Tip 7.30: You can view an error’s documentation directly from the Error List
Tip 7.31: You can do multicolumn sorting (secondary sort, and so forth) in both the Error List and the Task List
Tip 7.32: You can bind the show Errors, Warnings, and Messages buttons to keyboard shortcuts
Tip 7.33: How to show or prevent the Error List from appearing after a failed build
Watch Window
Tip 7.34: You can use the Watch window to quickly change a variable’s value
Tip 7.35: You can view numeric values in hexadecimal format in your debug windows
Immediate Window
Tip 7.36: You can use the Immediate Window as a glorified calculator or side-debugger within your debugger
A. Visual Studio Factoids
Visual Studio Q&A
Why is the executable file called devenv.exe instead of visualstudio.exe?
Is the Visual Studio logo an infinity symbol or Möbius strip?
What do the colors in the Visual Studio logo signify?
Solution Explorer: Is it on the left side or right side of the IDE?
Why is there a "Solution" concept?
Why Are the Tool Window Tabs Shown at the Bottom of a Tool Window Group and the File Tabs Are at the Top of the File Tab Channel?
Why is Common7 not Common8 or Common9?
B. Tips on Blogging Tips
Secret "Tip of the Day" Formula
Tip 1: Focus on one specific action per tip
Tip 2: Provide an image with each tip
Tip 3: Reference a credible source
Tip 4: Share and collect stories whenever possible
Tip 5: Queue up your tips far, far in advance
Tip 6: Set your tips to go live before dawn
Tip 7: Use Windows Live Writer to write and queue your tips
C. Software Testing Tips
Five Tips for Surviving as a Tester
Tip 1: Never assume anything
Tip 2: Learn from the bugs you missed
Tip 3: Help your developer however possible
Tip 4: Leave appropriate comments when closing bugs
Tip 5: Don’t just get it in writing
D. How I Started Programming
Hunt the Wumpus
Say "YoHo"
Typing on the TI-99 4A
Playing Nintendo
Will Solve Math Problems to Code
Studying in College
Enter Microsoft
Interviewing at Microsoft
Tip 252: You Can Make the Statement Completion Window Transparent
E. About the Author
F. Additional Resources for Developers from Microsoft Press
Visual Basic
Visual C#
Web Development
Data Access
.NET Framework
Other Developer Topics
G. More Great Developer Resources
Developer Step by Step
Developer Reference
Focused Topics
Index
SPECIAL OFFER: Upgrade this ebook with O’Reilly
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Next
Next Chapter
Microsoft® Visual Studio® Tips
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset