Solved

ImageList - extract Images from code

Posted on 2004-10-15
4
376 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA loop through headers using value 3 56
Help in WHSCRIPT 9 47
Use Multiple Forms 4 49
Added a column screws up code 5 49
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

912 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

20 Experts available now in Live!

Get 1:1 Help Now