在Visual Studio中创建构造函数的代码段或快捷方式 [英] Code snippet or shortcut to create a constructor in Visual Studio

查看:576
本文介绍了在Visual Studio中创建构造函数的代码段或快捷方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

Visual Studio 2010和C#.

Visual Studio 2010 and C#.

推荐答案

键入"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.

这篇关于在Visual Studio中创建构造函数的代码段或快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆