By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,548 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

Treeview/ImageList in a User Control

P: n/a
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.

--
Regards,
Webster
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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?

--
Regards,
Webster
"Webster" <we************@home.com> wrote in message
news:u$**************@TK2MSFTNGP10.phx.gbl...
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.

--
Regards,
Webster

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.