DimobjClass2AsClass2
PrivateSubClass_Initialize()
Debug.PrintTypeName(Me)&".Initialize"
SetobjClass2=NewClass2
SetobjClass2.Class1=Me
EndSub
PrivateSubClass_Terminate()
SetobjClass2=Nothing
Debug.PrintTypeName(Me)&".Terminate"
EndSub
在Class2中添加如下的代码:
DimobjClass1AsClass1
PublicPropertySetClass1(ByRefNewValueAsClass1)
SetobjClass1=NewValue
EndProperty
PrivateSubClass_Initialize()
Debug.PrintTypeName(Me)&".Initialize"
EndSub
PrivateSubClass_Terminate()
SetobjClass1=Nothing
Debug.PrintTypeName(Me)&".Terminate"
EndSub