[英]VB6 ActiveX Image.picture property
I am trying to create an ActiveX OCX in VB6 with a picture property. 我试图在VB6中创建一个带有图片属性的ActiveX OCX。 The picture property sets and gets the picture property of an image in the control.
picture属性设置并获取控件中图像的图片属性。 I want the user to be able to select the image during design time.
我希望用户能够在设计时选择图像。
Any ideas? 有任何想法吗?
Thanks 谢谢
Just define a property of type IPictureDisp
. 只需定义
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
Don't forget to save to/read from the prop bag: 不要忘记保存到手提包:
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.