Click here to Skip to main content
11,790,613 members (59,478 online)
Click here to Skip to main content

Tips to Save Time in Typing Repetitive Code in Visual Studio 2010 IDE

, 12 Sep 2013 CPOL 6.4K 15
Rate this:
Please Sign up or sign in to vote.
Tips to save time in typing repetitive code in Visual Studio 2010 IDE


Given below are some tips to save time in typing repetitive code in Visual Studio 2010 IDE.

Using the Code

  1. Use code snippets

    For example: prop is an expansion snippet; to use it type “prop”.

    Press Tab, Tab:

    Different code snippets in VS2010 are as follows:

    • try -> for exception handling block
    • tryf -> for exception handling block with finally block
    • for -> for loop block
    • foreach -> foreach loop block
    • svm -> static void Main block
    • ctor -> constructor block
    • testc -> test case block

    For example: region is a Surrounds With code snippet; to use it type “region”.

    Select the class or method to be surrounded with Region code snippet.

  2. Code rush to create code blocks

    Enum can be used create switch cases

    Switch is an expansion code snippet to create switch-case block, then type name of the enum in the square braces and press Shift + Down Arrow key to get the cases for switch case.

  3. Search any file directly from Find combo box.

    Type “>Open <>” in find combo box to get the file directly.

  4. Add namespaces in using block.

    For example: Type “ObservableCollection” and click “Ctrl+.” key combination to add namespaces in the using block.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Lalit Sharma
India India
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 4 Pin
Member 1029865826-Sep-13 21:11
memberMember 1029865826-Sep-13 21:11 
GeneralMy vote of 3 Pin
Menon Santosh14-Sep-13 6:07
professionalMenon Santosh14-Sep-13 6:07 
GeneralMy vote of 3 Pin
CIDev13-Sep-13 6:31
memberCIDev13-Sep-13 6:31 
GeneralMy vote of 3 Pin
johannesnestler13-Sep-13 1:37
memberjohannesnestler13-Sep-13 1:37 
Questiongood Pin
Jagz W12-Sep-13 22:47
memberJagz W12-Sep-13 22:47 
AnswerRe: good Pin
johannesnestler13-Sep-13 1:35
memberjohannesnestler13-Sep-13 1:35 
GeneralMy vote of 3 Pin
Sunasara Imdadhusen12-Sep-13 21:58
memberSunasara Imdadhusen12-Sep-13 21:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.1509028.1 | Last Updated 13 Sep 2013
Article Copyright 2013 by Lalit Sharma
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid