Shortcut to create properties in Visual Studio?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Shortcut to create properties in Visual Studio?

Message par ForumBot »

Shortcut to create properties in Visual Studio?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Shortcut to create properties in Visual Studio?

Message par ForumBot »

You could type "**prop**" and then press tab twice. That will generate the following.

```
public TYPE Type { get; set; }

```

Then you change "TYPE" and "Type":

```
public string myString {get; set;}

```

You can also get the full property typing "propfull" and then tab twice. That would generate the field and the full property.

```
private int myVar;

public int MyProperty
{
get { return myVar;}
set { myVar = value;}
}

```
Répondre

Revenir à « .NET & C# »