Solved

Problem with ImageList in VB5

Posted on 1997-10-17
3
339 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
[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
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
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…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

752 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