First, let’s start off by explaining what an automatic or auto-implemented property is. Earlier in VB.Net, to create a property, you would need a structure like this:
Private _Name As String = "" Public Property Name As String Get return _Name End Get Set(value As String) _Name = value End Set End Property
In current versions of VB.Net, you can create what is called an auto-implemented property. That is to say that, you can declare the property all on one line. The ‘backing field’ (the Private field above) is created automatically. So, the above could be done in one line, like this:
Public Property Name As String
If you’ve created an automatic (or auto-implemented) property, and for whatever reason, you need the fully expanded version (like the full example above), all you need to do is put your cursor on a blank line just below your property and type the letter ‘G’ (or ‘S’) and press your Enter key. Just so you’ll know, it does not create the internal lines for the Get and Set. Just the structure is created.
All Things DotNet Discussed – Winforms/ASP.Net/SharePoint/WPF