Just return a private member instead of calling the property again. Here you
call the property to returns the property value resulting in recursive
calls...
The example taken from the doc sis:
Class Class1
' Define a local variable to store the property value.
Private PropertyValue As String
' Define the property.
Public Property Prop1() As String
Get
' The Get property procedure is called when the value
' of a property is retrieved.
Return PropertyValue
End Get
Set(ByVal Value As String)
' The Set property procedure is called when the value
' of a property is modified.
' The value to be assigned is passed in the argument to Set.
PropertyValue = Value
End Set
End Property
End Class
--
Patrice
"Angel Mateos" <am*****@nospam.es> a écrit dans le message de news:
OS**************@TK2MSFTNGP04.phx.gbl...
Is posible something like this?
public Class Class1
property readonly InstanceName
get
return me.InstanceName
endget
end property
end class
(...)
dim MyVariable as Class1
msgbox class1.InstanceName -> shows MyVariable
(..)
Thanks!