Results 1 to 2 of 2

Thread: Load image to image list......

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    Load image to image list......

    I'm throwing together an app real quick and haven't used the imagelist control in a while. I've got my images in my image list control, but I can't remember how to access them.

    When an option button is clicked, I need my Image1 control to display a specified image from the imagelist control.

    VB Code:
    1. image1.picture = imagelist1.index (1)

    I know that's not right, but I can't remember how to specify the index value of the image in the imagelist. Any help is appreciated.

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Load image to image list......

    If have set Key for each image in your imagelist then use it or use index (it starts with 1) otherwise:
    VB Code:
    1. Private Sub Command1_Click()
    2.     Image1.Picture = ImageList1.ListImages("addnew").Picture
    3. End Sub
    4. 'or
    5. Private Sub Command1_Click()
    6.     Image1.Picture = ImageList1.ListImages(1).Picture
    7. End Sub

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