PropertyBag对象用来保存一个对象的多个实例之间需要传递的信息,它通过class模块和usercontrol模块中的InitProperties、ReadProperties和WriteProperties事件来工作,Property对象的唯一属性是Contents,它是Byte()型的,里面存储PropertyBag对象中的数据。
Function ReadProperties(Name As String,[DefaultValue]) As Variant
用来实现从PropertyBag对象中检索属性值
Name包含了PropertyBag对象中存储的属性值的名称,DefaultValue是一个Variant值,包含了属性的默认值
Sub WriteProperties(Name As String,Value,[DefaultValue])
用来向PropertyBag对象中存储一个属性值
另外:
默认一致性,由于只有在与指定的属性值不同时,才会存储该属性值,故必须为ReadProperties和WriteProperties方法指定相同的属性默认值。