A
Andrew Christiansen
Hey everyone. I have Visual Basic .NET 2003 and am trying to show images on
a treeview control. I have the imagelist on the form filled with images,
and have the ImageList property of the treeview control set to the imagelist
containing the images I want to be displayed next to each node.
It seems that no matter what I do there will be no images displayed next to
the nodes during runtime. I tried creating nodes during designtime using
the Nodes property, and the image appears next to the node in the designer
like it should, but when I run the app, there's no image visible, just a
blank space where the image is supposed to be followed by the node text.
Does this even when I add nodes at runtime, using code:
MyTreeview.Nodes.Add(New TreeNode("Node text", 0, 0))
0 is the index of the image in the imagelist that I want displayed.
I just noticed it does this with everything that uses the imagelist! The
toolbar, listview, treeview; everything behaves the same.
Also, this didn't always be a problem. It started acting this way when I
cut and pasted an imagelist control to a different form in one of my
projects. Its not a project-specific problem either, because I started a
new project and it does the same thing. I've tried restarting, running a
repair installation on VB.NET, nothing will fix it.
Even when I run the compiled app on another PC, same thing.
Anyone else having this weird problem? It's becoming very frustrating, and
would love to hear anyone's ideas. Thanks a lot.
Andrew
a treeview control. I have the imagelist on the form filled with images,
and have the ImageList property of the treeview control set to the imagelist
containing the images I want to be displayed next to each node.
It seems that no matter what I do there will be no images displayed next to
the nodes during runtime. I tried creating nodes during designtime using
the Nodes property, and the image appears next to the node in the designer
like it should, but when I run the app, there's no image visible, just a
blank space where the image is supposed to be followed by the node text.
Does this even when I add nodes at runtime, using code:
MyTreeview.Nodes.Add(New TreeNode("Node text", 0, 0))
0 is the index of the image in the imagelist that I want displayed.
I just noticed it does this with everything that uses the imagelist! The
toolbar, listview, treeview; everything behaves the same.
Also, this didn't always be a problem. It started acting this way when I
cut and pasted an imagelist control to a different form in one of my
projects. Its not a project-specific problem either, because I started a
new project and it does the same thing. I've tried restarting, running a
repair installation on VB.NET, nothing will fix it.
Even when I run the compiled app on another PC, same thing.
Anyone else having this weird problem? It's becoming very frustrating, and
would love to hear anyone's ideas. Thanks a lot.
Andrew