8. Now we'll add a write-only property called displayMoveComplete
to the class – it will ensure that the user is shown the status of the operation that they're performing. Add this property now:
Public Property Let displayMoveComplete(ByVal vNewValue As Boolean) showInfo = vNewValueEnd Property
When the user checks or unchecks the check box on the form, we pass in a true or false. When the box is checked, we set this property to true. In turn, the private variable showInfo
is set to true. Notice that when the MoveComplete
event fires, it checks the value of showInfo
. If it is true, then the enumerated reason and status of the move is displayed in a message box. Sure, we could have just declared the showInfo
variable as public and set it directly, but we would have violated the encapsulation approach. Using the standard property approach to set a private variable ensures that we use 'data hiding' through encapsulation.