假设picture映射出来以后为“aaa”,而且图片加到内部控件Picture1中那么代码如下:Public Property Get aaa() As Picture
Set aaa = Picture1.Picture
End PropertyPublic Property Set aaa(ByVal New_aaa As Picture)
Set Picture1.Picture = New_aaa
PropertyChanged "aaa"
End Property'从存贮器中加载属性值
Private Sub UserControl_ReadProperties(PropBag As PropertyBag) Set Picture = PropBag.ReadProperty("aaa", Nothing)
End Sub'将属性值写到存储器
Private Sub UserControl_WriteProperties(PropBag As PropertyBag) Call PropBag.WriteProperty("aaa", Picture, Nothing)
End Sub
Set aaa = Picture1.Picture
End PropertyPublic Property Set aaa(ByVal New_aaa As Picture)
Set Picture1.Picture = New_aaa
PropertyChanged "aaa"
End Property'从存贮器中加载属性值
Private Sub UserControl_ReadProperties(PropBag As PropertyBag) Set Picture = PropBag.ReadProperty("aaa", Nothing)
End Sub'将属性值写到存储器
Private Sub UserControl_WriteProperties(PropBag As PropertyBag) Call PropBag.WriteProperty("aaa", Picture, Nothing)
End Sub
框架是这样的