VB6 Property ActiveX Image.picture

I am trying to create an ActiveX OCX in VB6 with an image property. The image property sets and gets the image property of the image in the control. I want the user to be able to select an image during development.

Any ideas?

thanks

+4
source share
1 answer

Just define a property of type 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 

Remember to save / read from the gaskets:

 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 
+6
source

Source: https://habr.com/ru/post/1403143/


All Articles