mccainz2
asked on
treeview image problem
No matter what I do it seems that each node will have the same image applied to it from my imagelist.
Thes keys I use to access pictures from the imagelist work as I can use this on my form background with no trouble, however when I use these keys to the imagelist on my node I am stuck with the same image for every node.
With TreeView1
For Each obj1 In DencomGeo
.Nodes.Add , , obj1.GeoReigonName, obj1.GeoReigonName
.Nodes(obj1.GeoReigonName) .Image = ImageList1.ListImages("geo ").Picture
For Each obj2 In obj1.RDCcollection
.Nodes.Add obj1.GeoReigonName, tvwChild, obj2.rdcCode, obj2.RDCDescription
.Nodes(obj2.rdcCode).Selec tedImage = ImageList1.ListImages("rdc ").Picture
For Each obj3 In obj2.UICcollection
.Nodes.Add obj2.rdcCode, tvwChild, obj3.UIC, obj3.Description
For Each obj4 In obj3.clinicCollection
'We append the text 'DMISID' to our dmisid value so it can be
'accepted as a key. THis neccesitates that we remove that string
'from the key before we use the key as a sql parameter.
.Nodes.Add obj3.UIC, tvwChild, "DMISID" & obj4.clinicDMISD, obj4.clinicName
Next
Next
Next
Next
End With
Thes keys I use to access pictures from the imagelist work as I can use this on my form background with no trouble, however when I use these keys to the imagelist on my node I am stuck with the same image for every node.
With TreeView1
For Each obj1 In DencomGeo
.Nodes.Add , , obj1.GeoReigonName, obj1.GeoReigonName
.Nodes(obj1.GeoReigonName)
For Each obj2 In obj1.RDCcollection
.Nodes.Add obj1.GeoReigonName, tvwChild, obj2.rdcCode, obj2.RDCDescription
.Nodes(obj2.rdcCode).Selec
For Each obj3 In obj2.UICcollection
.Nodes.Add obj2.rdcCode, tvwChild, obj3.UIC, obj3.Description
For Each obj4 In obj3.clinicCollection
'We append the text 'DMISID' to our dmisid value so it can be
'accepted as a key. THis neccesitates that we remove that string
'from the key before we use the key as a sql parameter.
.Nodes.Add obj3.UIC, tvwChild, "DMISID" & obj4.clinicDMISD, obj4.clinicName
Next
Next
Next
Next
End With
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Azra, the short answer is that I sometimes become a tunnel-visioned ignoramus. That works like a charm. For some reason I never noticed the optional image parameter in that method.
THanks a bunch :)
THanks a bunch :)
.Nodes(obj2.rdcCode).Selec
with:
.Nodes(obj2.rdcCode).Image