?
Solved

Problem with ImageList in VB5

Posted on 1997-10-17
3
Medium Priority
?
341 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 80 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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…
Suggested Courses

719 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