Why declare and accessor Let and Set properties in VB6

In an older project, I found a property declaration in a class module that looks like this:

Public Property Get DrawObject() As Object
    Set DrawObject = m_obj
End Property
Public Property Let DrawObject(obj As Object)
    Set m_obj = obj
    Draw
End Property
Public Property Set DrawObject(obj As Object)
    Set m_obj = obj
    Draw
End Property

      

I would like to know why the property DrawObject

has both an accessory Let

and Set

; what could be the purpose of such a statement?

+3


source to share


1 answer


The only reason is to allow / support both assignment syntaxes:

set instance.DrawObject = obj

      



and

instance.DrawObject = obj

      

+2


source







All Articles