SYSK 38: Visual Studio 2005 Code Snippets

Did you know that if you type prop and press Tab key two times, VS will create a property definition for you as follows:
      private int myVar;

      public int MyProperty
          get { return myVar; }
          set { myVar = value; }

The int, myVar and MyProperty will be highlighted.  As you change int to your data type (e.g. string) in the data member variable declaration, the VS will change it correspondingly in the property declaration.  Same applies to myVar.  Cool, hah?

For more code snippets, click on Tools -> Code Snippets Manager…

Special thanks to Gary Lee who brought this to my attention.

Comments (2)

  1. Travis Owens says:

    Didn’t know that, just tried it, and that is pretty cool.

  2. Jeremiah Talkar says:

    Yes, this is an extremely useful feature and I particularly like the ability to create my own code snippets (refer to

    Talking of similar cool features, I would also recommend taking a look at ‘Refactor’ on the right-click menu for a class as well as ‘Implement Interface’ menu item.