Solved

Problem with ImageList in VB5

Posted on 1997-10-17
3
333 Views
Last Modified: 2008-02-20
I am using an ImageList attached to a TreeView in order to display icons in the TreeView. I am populating the TreeView from a different form. When I try to add my first node to the TreeView, and select an Image from the ImageList, the message "ImageList must be initialized before it can be used".
I added 4 pictures to the ImageList at design time. Furthermore, I used to do the extract on the same form, and never had this problem before.

I then tried this:  Set MyFirstForm.MyImageList.ListImages(1).Picture = LoadPicture(gSYSPath & "\greenlit.ico") but I keep getting the message "Run-time error '383'; Property is read-only".
Any ideas?
0
Comment
Question by:emmle
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
dirtdart earned 20 total points
ID: 1438050
Right click on the tree view control and move to properties. On the General tab about halfway down, you will see an imagelist property. Make sure the name of the imagelist you are trying to use is in this box.  If not, select it from the dropdown list.   The error you are getting indicates that you just haven't told the treeview what imagelist to use.
0
 

Author Comment

by:emmle
ID: 1438051
It works! How did I miss it? Thanks very much for your time.
0
 
LVL 5

Expert Comment

by:dirtdart
ID: 1438052
That's really simple to miss, so don't feel bad.  I once fought with a toolbar for a week because of this same situation.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VBA: Add rows to listbox based on criteria 7 64
VBA color chart bars 12 66
using Access 8 52
How does CurrentUser work? 10 25
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

757 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