Results 1 to 4 of 4

Thread: Putting an Image 'Property' in ActiveX Control

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2002
    Location
    Sri Lanka
    Posts
    9

    Talking Putting an Image 'Property' in ActiveX Control

    Hi! I want to insert an image property to a custom ActiveX control that I'm building. I tried the folowing code,




    Public Property Let Picture(s As Image)
    varPicture = s
    UserControl.Picture = varPicture.Picture
    PropertyChanged ("Picture")
    End Property

    Public Property Get Picture() As Image
    Picture = varPicture
    End Property

    but this doesn't appear to work. When I try to persist the values by using the 'UserControl_ReadProperties' and 'UserControl_WritePorperties' methods, vb gives me an error message.
    I can use a String property to make the user type in the path of the picture but that's so unprofessional

    Please Help
    Thanks in Advance

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    what is the error msg?

    what does the code look like for the ReadProperty and the WriteProperties subs ?
    -= a peet post =-

  3. #3
    New Member
    Join Date
    Apr 2002
    Location
    Phoenix Metro Area
    Posts
    6
    Without an error message, it looks pretty likely that the errors that you are getting is from not using the Set statement when assigning Objects to member variables and return functions.

    Try this...

    Public Property Let Picture(s As Image)
    Set varPicture = s
    UserControl.Picture = varPicture.Picture
    PropertyChanged ("Picture")
    End Property

    Public Property Get Picture() As Image
    Set Picture = varPicture
    End Property


    HTH,

    Joseph

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2002
    Location
    Sri Lanka
    Posts
    9

    Thumbs up

    Thanks for your help guys!

    I found out what was wrong. I was using the wrong kind of object.
    I tried to use an image object when all I had to do was use the stdPicture object.
    The code works fine now.

    Thank you for replying promptly to this message.
    It's nice to know that there are knowledgeable people out there

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width