Results 1 to 2 of 2

Thread: Problem with usercontrol and pictures

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,158

    Problem with usercontrol and pictures

    I have two image controls in my usercontrol. in the activex wizard i have selected the 'picture' property for the first image and for the second image i have created my own property as 'pic1'.

    I placed the usercontrol in the form and have assigned the pictures to both the images. i closed the form and when again the opened the form the picture of the second image(i.e pic1) is showing as none ??

    Here is the code of my usercontrol
    Code:
    'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
    'MappingInfo=Image1,Image1,-1,Picture
    Public Property Get Picture() As Picture
        Set Picture = Image1.Picture
    End Property
    
    Public Property Set Picture(ByVal New_Picture As Picture)
        Set Image1.Picture = New_Picture
        PropertyChanged "Picture"
    End Property
    
    'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
    'MappingInfo=Image2,Image2,-1,Picture
    Public Property Get Pic1() As Picture
        Set Pic1 = Image2.Picture
    End Property
    
    Public Property Set Pic1(ByVal New_Pic1 As Picture)
        Set Image2.Picture = New_Pic1
        PropertyChanged "Pic1"
    End Property
    
    'Load property values from storage
    Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
    
        Set Picture = PropBag.ReadProperty("Picture", Nothing)
        Set Picture = PropBag.ReadProperty("Pic1", Nothing)
    End Sub
    
    'Write property values to storage
    Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
    
        Call PropBag.WriteProperty("Picture", Picture, Nothing)
        Call PropBag.WriteProperty("Pic1", Picture, Nothing)
    End Sub

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,158

    Re: Problem with usercontrol and pictures

    Heres the usercontrol
    Attached Files Attached Files

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