Short cut to create properties in Visual Studio

Posted: July 9, 2013 in .Net

Some people are really fast in creating properties and you might have thought how they do it.This tip is for you if you did not know it before 🙂

You can type “prop” and then press tab twice, that will generate the following.

public int MyProperty
{
get;
set;
}

You can also get the full property by typing “propfull” and tabbing twice, that would generate the field and the full property.

private int myVar;

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

Advertisements
Comments
  1. Harsha says:

    That is a very nice tip…Especially for a beginner like me..Thanks. 🙂

  2. Shwetha says:

    Good tip.. This really saves the time spent on typing.. Thanks.. 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s