Treeview/ImageList in a User Control

W

Webster

Hello,

I created a User Control consisting of a TreeView and an ImageList. I've
populated the ImageList with pictures (design-time using the Properties
Window), and I've added some Nodes to the TreeView setting certain Nodes to
different graphics from the ImageList (once again at design-time). The
problem is, when I add the User Control to my main form (of a seperate
project), the icons of the TreeView displayed on the control all change to
the 0th index graphic of the ImageList.

For example, if I have node1 with graphic1, node2 and graphic2 etc., on the
main form, node1, node2, ... *all* have graphic1.

Is there some extra process I am missing to retain the indices of the
graphics for the TreeView?? I haven't even coded anything since this is
just point-and-click so far.

Thanks for any help.
 
W

Webster

I added code to make the control load the default nodes programmatically (in
the Load event of the User Control) and it works ok, but I have to specify
the image indices of the icon to be associated with the node. Why is this
so?? Why doesn't the User Control retain the indices placed via the
Properties Window?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top