如果你只是用来存储图片的,你可以放置图片框的数组(维数决定于你需要的
图片属性数量,并且设置他们为不可见的)假定你有两个需要设置图片的属性如下
'----------------属性1--------------------------
Public Property Get backgroundPicture() As Picture
Set backgroundPicture = Picture1(0).Picture
End PropertyPublic Property Set backgroundPicture(ByVal New_backgroundPicture As Picture)
Set Picture1(0).Picture = New_backgroundPicture
PropertyChanged "backgroundPicture"
End Property
'----------------属性2--------------------------
Public Property Get ForegroundPicture() As Picture
Set ForegroundPicture = Picture1(1).Picture
End PropertyPublic Property Set ForegroundPicture(ByVal New_ForegroundPicture As Picture)
Set Picture1(1).Picture = New_ForegroundPicture
PropertyChanged "ForegroundPicture"
End Property
'从存贮器中加载属性值
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Set Picture1(0).Picture = PropBag.ReadProperty("backgroundPicture", Nothing)
Set Picture1(1).Picture = PropBag.ReadProperty("ForegroundPicture", Nothing)
End Sub'将属性值写到存储器
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("backgroundPicture", Picture1(0).Picture, Nothing)
Call PropBag.WriteProperty("ForegroundPicture", Picture1(1).Picture, Nothing)
End Sub
图片属性数量,并且设置他们为不可见的)假定你有两个需要设置图片的属性如下
'----------------属性1--------------------------
Public Property Get backgroundPicture() As Picture
Set backgroundPicture = Picture1(0).Picture
End PropertyPublic Property Set backgroundPicture(ByVal New_backgroundPicture As Picture)
Set Picture1(0).Picture = New_backgroundPicture
PropertyChanged "backgroundPicture"
End Property
'----------------属性2--------------------------
Public Property Get ForegroundPicture() As Picture
Set ForegroundPicture = Picture1(1).Picture
End PropertyPublic Property Set ForegroundPicture(ByVal New_ForegroundPicture As Picture)
Set Picture1(1).Picture = New_ForegroundPicture
PropertyChanged "ForegroundPicture"
End Property
'从存贮器中加载属性值
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Set Picture1(0).Picture = PropBag.ReadProperty("backgroundPicture", Nothing)
Set Picture1(1).Picture = PropBag.ReadProperty("ForegroundPicture", Nothing)
End Sub'将属性值写到存储器
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("backgroundPicture", Picture1(0).Picture, Nothing)
Call PropBag.WriteProperty("ForegroundPicture", Picture1(1).Picture, Nothing)
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货