sorry...
come dicevo il codice è moooolto banale
codice:
Option Explicit
Public Property Get MaskColor() As OLE_COLOR
MaskColor = UserControl.MaskColor
End Property
Public Property Let MaskColor(ByVal NewValue As OLE_COLOR)
UserControl.MaskColor = NewValue
PropertyChanged "MaskColor"
End Property
Public Property Get Picture() As StdPicture
Set Picture = UserControl.pic.Picture
End Property
Public Property Set Picture(ByVal NewValue As StdPicture)
With UserControl
Set .pic.Picture = NewValue
Set .Picture = .pic.Image
Set .MaskPicture = .pic.Image
End With
Call CheckResize
PropertyChanged "Picture"
End Property
Private Sub CheckResize()
With UserControl
If (.pic.Picture = 0) Then
.imgNoPic.Top = 0
.imgNoPic.Left = 0
.Height = .imgNoPic.Height
.Width = .imgNoPic.Width
.imgNoPic.Visible = True
Else
.imgNoPic.Visible = False
.Height = .pic.Height
.Width = .pic.Width
End If
End With
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
'READ
With UserControl
.MaskColor = PropBag.ReadProperty("MaskColor", Ambient.BackColor)
Set pic.Picture = PropBag.ReadProperty("Picture", LoadPicture(""))
Set .Picture = .pic.Image
Set .MaskPicture = .pic.Image
End With
Call CheckResize
End Sub
Private Sub UserControl_Resize()
Call CheckResize
End Sub
Private Sub UserControl_Terminate()
With UserControl
.Picture = LoadPicture("")
.pic.Picture = LoadPicture("")
Set .pic = Nothing
.imgNoPic.Picture = LoadPicture("")
Set .imgNoPic = Nothing
End With
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
'WRITE
Call PropBag.WriteProperty("MaskColor", UserControl.MaskColor, Ambient.BackColor)
Call PropBag.WriteProperty("Picture", UserControl.pic.Picture, LoadPicture(""))
End Sub
grazie dell'aiuto!