J
Just Me
If I add an image to an imagelist using
imageList.Images.Add...
And use it with a tree node
tn.ImageIndex = imageList.Images.Count-1
This is the actual code:
Win32.Shell.SHGetFileInfo(NodePath, 256, fileinfo, cbFileInfo, flags)
tvFolders.ImageList.Images.Add(Icon.FromHandle(fileinfo.hIcon))
tn.ImageIndex = tvFolders.ImageList.Images.Count - 1
It may be that the image is already in the imagelist.
I'd like to check.
The following was suggested to get the index:
Index = imageList.Images.IndexOf(myImage)
But I find IndexOf is not supported.
The only thing I can think of is to save hIcon in an two column array along
with Count=1 and check before I add to the imagelist. But if the imagelist
can tell me if it's already in it I'd rather not have an extra data
structure around.
1)Anyone know how to check the ImageList??
2)If I must have the data structure is an array (hIcon,index) the best one?
imageList.Images.Add...
And use it with a tree node
tn.ImageIndex = imageList.Images.Count-1
This is the actual code:
Win32.Shell.SHGetFileInfo(NodePath, 256, fileinfo, cbFileInfo, flags)
tvFolders.ImageList.Images.Add(Icon.FromHandle(fileinfo.hIcon))
tn.ImageIndex = tvFolders.ImageList.Images.Count - 1
It may be that the image is already in the imagelist.
I'd like to check.
The following was suggested to get the index:
Index = imageList.Images.IndexOf(myImage)
But I find IndexOf is not supported.
The only thing I can think of is to save hIcon in an two column array along
with Count=1 and check before I add to the imagelist. But if the imagelist
can tell me if it's already in it I'd rather not have an extra data
structure around.
1)Anyone know how to check the ImageList??
2)If I must have the data structure is an array (hIcon,index) the best one?