|
Create a control, put two image controls image1 and image2 on it
Use the wizard to build the attributes pic0 and pic1, and map them to the picture attributes of image1 and image2, respectively. The following code is automatically generated. At design time, the attributes of pic0 and pic1 (bmp picture) are formulated. Nothing, after opening and saving, the picture also disappears. The automatically generated code is as follows. The master can help me to see what went wrong?
Option Explicit
'note! Do not delete or modify the following commented lines!
'MappingInfo = Image1, Image1, -1, Picture
Public Property Get Pic0 () As Picture
Set Pic0 = Image1.Picture
End Property
Public Property Set Pic0 (ByVal New_Pic0 As Picture)
Set Image1.Picture = New_Pic0
PropertyChanged "Pic0"
End Property
'note! Do not delete or modify the following commented lines!
'MappingInfo = Image2, Image2, -1, Picture
Public Property Get Pic1 () As Picture
Set Pic1 = Image2.Picture
End Property
Public Property Set Pic1 (ByVal New_Pic1 As Picture)
Set Image2.Picture = New_Pic1
PropertyChanged "Pic1"
End Property
'Load attribute values from memory
Private Sub UserControl_ReadProperties (PropBag As PropertyBag)
Set Picture = PropBag.ReadProperty ("Pic0", Nothing)
Set Picture = PropBag.ReadProperty ("Pic1", Nothing)
End Sub
'Write attribute value to memory
Private Sub UserControl_WriteProperties (PropBag As PropertyBag)
Call PropBag.WriteProperty ("Pic0", Picture, Nothing)
Call PropBag.WriteProperty ("Pic1", Picture, Nothing)
End Sub |
|