Code snippet or shortcut to create a constructor in Visual Studio

前端 未结 17 1614
悲哀的现实
悲哀的现实 2020-12-23 12:57

What is the code snippet or shortcut for creating a constructor in Visual Studio?

Visual Studio 2010 and C#.

17条回答
  •  春和景丽
    2020-12-23 13:42

    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.

提交回复
热议问题