Solved

ImageList - extract Images from code

Posted on 2004-10-15
4
379 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

734 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