且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Visual Studio中创建构造函数的代码段或快捷方式

更新时间:2023-01-31 12:09:31

键入"ctor" + TAB + TAB (两次按Tab键).这将为您所在的类创建默认的构造函数:

Type "ctor" + TAB + TAB (hit the Tab key twice). This will create the default constructor for the class you are in:

public MyClass()
{

}

在某些情况下,您似乎必须按两次 TAB .

It seems that in some cases you will have to press TAB twice.