Results 1 to 2 of 2

Thread: ActiveX user control problem

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2002
    Posts
    45

    ActiveX user control problem

    This is peeving me, I know I am missing something simple.

    So I create an ActiveX user control called MyButtonControl with an imagelist and image component in it.

    When an instance is created in design time, I want the image to default to a certain button.


    Private Sub MyButtonControl_Initialize()

    Debug.Print "Initialize"
    imgMain.Picture = imlMain.ListImages(1).Picture

    End Sub

    The problem is the picture never changes from the default gray.

    Any ideas?

  2. #2
    Junior Member
    Join Date
    Oct 2002
    Location
    New Zealand
    Posts
    27
    I have created a blank user control and added an imagelist to the control with 2 images in it. Your code works perfectly to display a specified (1) image from the imagelist control.

    I also tried it with custom size images and it still works.

    My guess is that you are executing some other code after the initialization that causes it not to be displayed.
    Try painting the image to your usercontrol picture property or if that is what you are doing, then to an image control that would be visible in the control.

    The only other thing that I can think of is if you are using transparency for your control - you may not me able to see anything in it without the mask propert set.

    Graham
    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