What is the code snippet or shortcut for creating a constructor in Visual Studio?
Visual Studio 2010 and C#.
Type ctor, and then press the Tab key.
A parameterized constructor is generated with the selected members.
Type "ctor" + TAB + TAB (hit the Tab key twice). This will create the default constructor for the class you are in:
public MyClass()
{
}
It seems that in some cases you will have to press TAB twice.
For the full list of snippets (little bits of prefabricated code) press Ctrl+K and then Ctrl+X. Source from MSDN. Works in Visual Studio 2013 with a C# project.
So how to make a constructor
Update: You can also right-click in your code where you want the snippet, and select Insert Snippet from the right-click menu
Type the name of any code snippet and press TAB.
To get code for properties you need to choose the correct option and press TAB twice because Visual Studio has more than one option which starts with 'prop', like 'prop', 'propa', and 'propdp'.