Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Initialize a ImageList 1

Status
Not open for further replies.

balajee

Programmer
Jun 29, 2000
134
0
0
NZ
Hi

I am trying to create a TreeView using an ImageList control. I am creating the root node using Add method as:

TreeView1.Nodes.Add , , "Shelby","North Shelby", "Bold"

But when I run the program I get following error message:

Runtime error:35613

ImageList must be initialized before it can be used.

Can sombody please let me know how do I initialize the ImageList?

balajee [sig][/sig]
 
;( so, you've met the same problem of mine. Have you got
the answer? It seems no one can help.
 
Hi

All you need to do is put the following line before the .Add line:

TreeView1.ImageList = ImageList1

where ImageList1 is an imagelist that is on the same form as the Treeview.

Cheers,

Madlarry
 
Or, if you don't want to initialize it by code you can set the image list at design time, by right clicking your data tree choosing properties and then set the imagelist to wichever you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top