简体   繁体   中英

Visual Studio 2013 Autocompletion of VB.NET Properties

I have recently installed Visual Studio 2013 on my PC and, though the majority of the IDE is great, it seems that the auto-completion of VB.NET properties does not work as it used to.

Previously (VS 2008) after typing something like:

Public Property Test() As String

...and pressing Return , the body of the Property would be autocompleted for me...

Public Property Test() As String
    Get

    End Get
    Set(value As String)

    End Set
End Property

In VS2013, however, this doesn't seem to be the case anymore, though if I type:

Public ReadOnly Property Test() As String

..and press Return , the property is finished for me.

Am I missing something here, or is this how it's going to be from now on?

In VS 2010 (what i am using) the behaviour is the same as in VS 2013. The latter is a readonly property which must have and can only have a getter, so this is not valid:

Public ReadOnly Property Test() As String

That's why VS automatically adds it if you press Return . If you want the same behaviour with a "normal"/ auto-Implemented property you have to begin a Get like:

Public Property Test() As String
Get

if you now press Return you get the full body:

Public ReadOnly Property Test() As String
    Get

    End Get
    Set(value As String)

    End Set
End Property

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM