Home All Groups Group Topic Archive Search About

treeview and imagelist

Author
8 Apr 2005 3:44 PM
Sam
Hi again...
I'm trying to assign icons to the root nodes of my treeview.

I've got an imagelist that contains 6 images.
I've assigned this imagelist to be the one of my treeview.
(I've used the properties manager for the above)

I assign an icon to a node as this:

tvRelations.Nodes(iCntr).ImageIndex = 0

where iCntr represents the index of my node.
Unfortunately no images is being displayed... What's wrong ?

Thx

Author
8 Apr 2005 5:58 PM
Herfried K. Wagner [MVP]
"Sam" <samuel.berthe***@voila.fr> schrieb:
> I'm trying to assign icons to the root nodes of my treeview.
>
> I've got an imagelist that contains 6 images.
> I've assigned this imagelist to be the one of my treeview.
> (I've used the properties manager for the above)
>
> I assign an icon to a node as this:
>
> tvRelations.Nodes(iCntr).ImageIndex = 0
>
> where iCntr represents the index of my node.
> Unfortunately no images is being displayed... What's wrong ?

If you are calling 'Application.EnableVisualStyles' in order to enable
Windows XP visual styles for your application, call 'Application.DoEvents'
directly after the call to 'EnableVisualStyles'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>