This is a really good way to demonstrate properties versus variables. When I teach someone object oriented programming for the first time, most people initially struggle with what a property really is. They appear and act so much like a variable that we can get stuck on thinking it is. In reality, a property contains two special kinds of function calls, the getter and the setter.
When you retrieve a property value, it calls the getter and executes some code to retrieve the value. It is typically just a single line of code, but can be as much code as needed. When you set the property to a value, it calls the setter function. More commonly the setter has more code because it can validate and even perform an action on the object.
Here is a typical property declaration that "maps" the property to an internal variable in the class:
'* Internal private variable
Private m_Value As Single
'* Property declaration
Public Property Value() As Single
Get
Return m_Value
End Get
Set(ByVal value As Single)
If value <> m_Value Then
'* Limit the value within the Min-Max range
m_Value = Math.Max(Math.Min(value, 9999), -999)
'*Invalidate to force a screen refresh
Me.Invalidate()
End If
End Set
End Property
You can see the "getter" retrieves what is stored in the variable m_Value and simply returns the value. However, the "setter" has a bit more code. It limits the value between -999 and 9999, then puts it into the variable m_Value.
So this is why directly referencing a property can be in efficient, especially in a large loop.