关于Class_WriteProperties事件
下面是一个类中的代码:
为什么在关闭程序时
没有触发Class_WriteProperties事件
(已将类的persistable属性设为 1 )
Option Explicit
Dim strT As String
Private myT As Variant
Public Property Get myTest() As String
myTest = strT
PropertyChanged "myTest"
End Property
Public Property Let myTest(newTest As String)
strT = newTest
PropertyChanged "myTest"
End Property
Private Sub Class_ReadProperties(PropBag As PropertyBag)
myTest = PropBag.ReadProperty("myTest", myT)
End Sub
Private Sub Class_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "myTest", myTest, myT
End Sub