我不知道怎么编写usercontrol的picture属性!想参考下

解决方案 »

  1.   

    picture属性,就是指向一个stdpicture对象,一般用set赋值
      

  2.   

    Private New1 As Picture
    Public Property Set PictureIm(ByVal val As Picture)
    Set New1 = val
    PropertyChanged "PictureIm"
    usercontrol.Picture = New1
    End Property
    Public Property Get PictureIm() As Picture
    Set PictureIm = New1
    End Property
    Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
    Set New1 = PropBag.ReadProperty("new1", Nothing)
    End Sub
    Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
    PropBag.WriteProperty "usuallyimage", New1, Nothing
    End Sub
    '这个是我写的,可以添加图片,但运行后图片就消失了!…………
    '哪位朋友知道怎么了
      

  3.   

    '最后一个事件错了
    PropBag.WriteProperty "pictureIm", New1, Nothing