469,346 Members | 6,467 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,346 developers. It's quick & easy.

Treeview/ImageList in a User Control

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
1 2082
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.

Similar topics

1 post views Thread by Anthony Boudouvas | last post: by
3 posts views Thread by feel | last post: by
1 post views Thread by paradox | last post: by
1 post views Thread by Tom | last post: by
reply views Thread by Sarika | last post: by
7 posts views Thread by amruta | last post: by
1 post views Thread by Jeffrey Walton | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.