[英]VB6 ActiveX Image.picture property
我試圖在VB6中創建一個帶有圖片屬性的ActiveX OCX。 picture屬性設置並獲取控件中圖像的圖片屬性。 我希望用戶能夠在設計時選擇圖像。
有任何想法嗎?
謝謝
只需定義IPictureDisp
類型的屬性即可。
Public Property Get Picture() As IPictureDisp
Set Picture = UserControl.Picture
End Property
Public Property Set Picture(ByVal p As IPictureDisp)
Set UserControl.Picture = p
PropertyChanged "Picture"
End Property
不要忘記保存到手提包:
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
With PropBag
...
Set Me.Picture = .ReadProperty("Picture", Nothing)
...
End With
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
With PropBag
...
.WriteProperty "Picture", Me.Picture, Nothing
...
End With
End Sub
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.