I'm not that familar with the treeview control but learning. I'm using a treecontrol to list all the master and sub projects (parent/child) for a given client. I've gotten to the point where I now need to add an image for the node. If the project is closed, I have a red X image, and if the project is open display a green check.
I would prefer not to refer to the images by filename. I would rather keep a local lookup table in the MDB front end client, as that I have control over. But I can't even get this to work refenceing the picture as a local file.
I've been using the MS help page here: http://msdn.microsoft.com/en-us/library/aa443198(VS.60).aspx
But it's confued me and I'm really starting to butcher this up. So I need some help
I would like to build up the imagelist "istatus" with the two images, and then apply it to the Nodes.add by the imagelist refernce number.
I can't get the image added to the control using the local table with dlookup. Appears to load when using the file name. But I now get an error at nodes.add when trying to apply the image. Gives me the error "Object doesn't support this property or method"
Any suggestions ?
Dim istatus As New ImageList
' Set imgx = istatus.ListImages.Add(, 1, LoadPicture(DLookup("ImageObj", "tlkp_Images", "ImageID = 1")))
Set imgx = istatus.ListImages.Add(, 2, LoadPicture("C:\PP_projectmgr\closed.bmp"))
'....Node refence later in the code...
Set nodParent = tvwTree.Nodes.Add(, , "a" & !fldProjectIndexNo, !fldProject, imgx(2))