1. Ctrl+Shift+V
Ctrl+Shift+V will cycle through the items in the clipboard ring. This allows you to copy multiple things before even attempting to paste them and then paste them in order at a later point. Keep in mind that the clipboard ring holds up to 20 items.
2. Line Numbers
Line numbers make it much easier to discuss your code with someone else, especially during code reviews or technical demos.
To add line numbers to your code
- Click Tools menu and select Options...


- Expand the Text Editor tree item
- Select the C# (or Basic) tree item
- In the Display section, check Line numbers
NOTE: The line numbers will be displayed on the left of the text editor.
3. Snippets
Visual Studio has code snippets built in or you can create your own. You can also drag-and-drop sections of code to the Toolbar and use them as snippets.
4. Tab Groups
If you need to work with multiple windows you can group them together using tab groups. Right-click on the window tab and select
New Horizontal Tab Group (or
New Vertical Tab Group). You can then drag-and-drop other windows to the tab group to add or remove them.
5. Regions
Regions allow you to organize your code in a clean and concise manner. I am a firm believer in the practice of only pulling logic into a method if it will be used more than once. I accomplish this using regions to group sections of code that are related and act like a function but are only executed once. I also use regions to group sections of my objects together (i.e. Fields, Properties, Methods).
To place code within a region, simple place the
#region a
nd
#endregion tags around the code. For example
public void Foo()
{
#region My Region
// Add code here...
#endregion
}
This would allow the method Foo to be collapsed to look like the following:
public void Foo()
{
}
6. Auto-complete (Ctrl+Space)
Talk about a time saver! I think once I discovered
Ctrl+Space I was unable to type a full word again. Even better, intellisense will display suggestions if there is more than one possibility with what you have already typed.
Friday, December 05, 2008 1:26 PM