Code snippet or shortcut to create a constructor in Visual Studio

前端 未结 17 1679
悲哀的现实
悲哀的现实 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:44

    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

    1. Press Ctrl+K and then Ctrl+X
    2. Select Visual C#
    3. Select ctor
    4. Press Tab

    Update: You can also right-click in your code where you want the snippet, and select Insert Snippet from the right-click menu

提交回复
热议问题