gpt4 book ai didi

VB6 ActiveX Image.picture 属性

转载 作者:行者123 更新时间:2023-12-05 00:35:05 27 4
gpt4 key购买 nike

我正在尝试在 VB6 中创建一个带有图片属性的 ActiveX OCX。图片属性设置和获取控件中图片的图片属性。我希望用户能够在设计时选择图像。

有任何想法吗?

谢谢

最佳答案

只需定义一个 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

不要忘记保存到 Prop 包/从 Prop 包中读取:
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

关于VB6 ActiveX Image.picture 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9844891/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com