Click here to Skip to main content
16,018,353 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi. I have VS 2010 Ultimate installed on both my laptop and desktop at work. However whenever i type the header for a property block i.e:

Public Property Name() as string


VS fails to auto generate the Get/Set blocks as well as the end property statement. Your help would be much appreciated!
Posted

1 solution

Type Property and press the Tab key.
It will automatically generate:
VB
Private newPropertyValue As String
Public Property NewProperty() As String
    Get
        Return newPropertyValue
    End Get
    Set(ByVal value As String)
        newPropertyValue = value
    End Set
End Property
for you, and be ready to set the type and name for you.
 
Share this answer
 
Comments
Manas Bhardwaj 7-Aug-13 11:11am    
+5!
TheMaddCoder 7-Aug-13 11:15am    
Thank you OriginalGriff. This provides a solution for me.

However I am still wondering how to get it to generate the get set code and end property statement after typing the property header and pressing enter. VS for some reason no longer will do this.

Thanks again for your help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900