Results 1 to 8 of 8

Thread: Imagelist

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2004
    Location
    Lucenec, Slovakia
    Posts
    154

    Exclamation Imagelist

    Hi guys,

    Can anybody help me how is it possible to define an imagelist for userform?
    I would like to create userform with toolbar and I would like to define form some buttons icons.

    Thanks.

    Boris
    Boris

    the mistake must be between the keyboard and the chair!

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Imagelist

    Attached is a sample project I just whipped together which uses a ImageList to populate a toolbar.

    It is pretty easy.

    1. Place both controls on your form.
    2. Add the images to your ImageList. The Images are added via the Images tab on its properties page. Each image will require you to make an entry in the "Key" textbox. This is how you will identify which image goes to which toolbar button.
    3. Once you have finished adding the images, open the Property Page of the Toolbar.
    4. On the General Tab of the toolbars property page, you will see a dropdown called "ImageList". Click that and the name of the ImageList on your form should be there. Click on it. This will associate the Imagelist itself with the toolbar.
    5. Now click the Buttons tab on the toolbar property page.
    6. Click "Insert Button"
    7. A button with no image will be placed on the toolbar.
    8. We already have the ImageList, as a whole, associated with the toolbar. Now we must associate individual images with individual toolbar buttons. The is where the "Key" that you created when you added the images to the ImageList comes into play.
    9. You will enter the "Key" twice on the Buttons property page. Once in the "Key" text box, and once in the "Image" textbox. Once that is done, click apply. The image you have chosen for this button will appear on the button.

    Repeat steps six through nine as needed.

    To code this buttons, use the built in Toolbar button click event as demonstrated in my attached example.
    Attached Files Attached Files

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2004
    Location
    Lucenec, Slovakia
    Posts
    154

    Re: Imagelist

    Quote Originally Posted by Hack
    Attached is a sample project I just whipped together which uses a ImageList to populate a toolbar.

    It is pretty easy.

    1. Place both controls on your form.
    2. Add the images to your ImageList. The Images are added via the Images tab on its properties page. Each image will require you to make an entry in the "Key" textbox. This is how you will identify which image goes to which toolbar button.
    3. Once you have finished adding the images, open the Property Page of the Toolbar.
    4. On the General Tab of the toolbars property page, you will see a dropdown called "ImageList". Click that and the name of the ImageList on your form should be there. Click on it. This will associate the Imagelist itself with the toolbar.
    5. Now click the Buttons tab on the toolbar property page.
    6. Click "Insert Button"
    7. A button with no image will be placed on the toolbar.
    8. We already have the ImageList, as a whole, associated with the toolbar. Now we must associate individual images with individual toolbar buttons. The is where the "Key" that you created when you added the images to the ImageList comes into play.
    9. You will enter the "Key" twice on the Buttons property page. Once in the "Key" text box, and once in the "Image" textbox. Once that is done, click apply. The image you have chosen for this button will appear on the button.

    Repeat steps six through nine as needed.

    To code this buttons, use the built in Toolbar button click event as demonstrated in my attached example.
    I was already trying do it this way. But after defining imagelist and images I did not see imagelist in toolbar as you described it in step 4. Do you have any idea, where is a mistake?
    Boris

    the mistake must be between the keyboard and the chair!

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 2004
    Location
    Lucenec, Slovakia
    Posts
    154

    Re: Imagelist

    Quote Originally Posted by Hack
    Attached is a sample project I just whipped together which uses a ImageList to populate a toolbar.

    It is pretty easy.

    1. Place both controls on your form.
    2. Add the images to your ImageList. The Images are added via the Images tab on its properties page. Each image will require you to make an entry in the "Key" textbox. This is how you will identify which image goes to which toolbar button.
    3. Once you have finished adding the images, open the Property Page of the Toolbar.
    4. On the General Tab of the toolbars property page, you will see a dropdown called "ImageList". Click that and the name of the ImageList on your form should be there. Click on it. This will associate the Imagelist itself with the toolbar.
    5. Now click the Buttons tab on the toolbar property page.
    6. Click "Insert Button"
    7. A button with no image will be placed on the toolbar.
    8. We already have the ImageList, as a whole, associated with the toolbar. Now we must associate individual images with individual toolbar buttons. The is where the "Key" that you created when you added the images to the ImageList comes into play.
    9. You will enter the "Key" twice on the Buttons property page. Once in the "Key" text box, and once in the "Image" textbox. Once that is done, click apply. The image you have chosen for this button will appear on the button.

    Repeat steps six through nine as needed.

    To code this buttons, use the built in Toolbar button click event as demonstrated in my attached example.
    what kind of picture file I can attach to imagelist?
    Boris

    the mistake must be between the keyboard and the chair!

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Imagelist

    Quote Originally Posted by bolcskei
    I was already trying do it this way. But after defining imagelist and images I did not see imagelist in toolbar as you described it in step 4. Do you have any idea, where is a mistake?
    Have you downloaded and looked at my example?

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Imagelist

    Quote Originally Posted by bolcskei
    what kind of picture file I can attach to imagelist?
    Pretty much any icon that you want.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 2004
    Location
    Lucenec, Slovakia
    Posts
    154

    Re: Imagelist

    Quote Originally Posted by Hack
    Have you downloaded and looked at my example?
    I have only VBA and thefore I was not able to import your example.
    Boris

    the mistake must be between the keyboard and the chair!

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Imagelist

    Quote Originally Posted by bolcskei
    I have only VBA and thefore I was not able to import your example.
    Then I don't know how to do what you need done as I've never developed anything using VBA.

    Moved to Office Development.

    Help the folks here out. What are you using:

    Excel VBA
    Word VBA
    Access VBA
    ? VBA

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