Public Property Changeaheight() As Integer
Get
Return newValue
End Get
Set(ByVal value As Integer)
newValue = value
End Set
End Property
and int shows me an error int the newValue parameter. this kind of error:
and int shows me an error int the newValue parameter. this kind of error:
newValue' is not declared. It may be inaccessible due to its protection level
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Satyapriya NayakRank #47 · 31.5K reputationPosted Feb 26, 2013, 5:09 AM EST
VulpesRank #55 · 29.2K reputationPosted Feb 26, 2013, 5:34 AM EST
This is what's called an auto-implemented property and the VB.NET compiler replaces it with something similar to the previous code. However, the Private field is not directly accessible in this case and you always have to get or set the field via the Property. For example:
Changeaheight = 10
Console.WriteLine(Changeaheight) ' prints 10