Solved

ImageList - extract Images from code

Posted on 2004-10-15
4
375 Views
Last Modified: 2013-12-26
Hi!

On a form I have an ImageList control named "ImageList"
I have added two images to it, and set it's keys to "Image1" and "Image2"
How do I set my form's Icon property "Image2" from this ImageList control?

I have tried the following, but it doesn't work:

'--------------------------------------------
Private Sub MDIForm_Load()
    Set Me.Icon = ImageList.ListImages.Item(2).Picture
End Sub
'-------------------------------------------

But I get "Invalid Property Value"

Thanks!
0
Comment
Question by:dbrckovi
  • 3
4 Comments
 
LVL 10

Expert Comment

by:fds_fatboy
ID: 12318721
Remove Set.

Private Sub MDIForm_Load()
    Me.Icon = ImageList.ListImages.Item(2).Picture
End Sub
0
 
LVL 10

Expert Comment

by:fds_fatboy
ID: 12318746
Actually it's odd - so far I can't replicate your problem - with set or not.
0
 
LVL 10

Accepted Solution

by:
fds_fatboy earned 125 total points
ID: 12318762
Now I can - You are using a bitmap in your list image - try this:
    Me.Icon = ImageList1.ListImages.Item(2).ExtractIcon
0
 
LVL 11

Author Comment

by:dbrckovi
ID: 12318812
Thanks!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now