
TreeView Control and ImageList
I have some code that I am trying to use to display a tree view of our data.
I have include the code below. There are two problems.
1) The line 'Set NRCSTreeView.ImageList = imlImages' does not work. This
should be an ImageList object. I have checked the classid and Visual
Interdev seems to think that it is an ImageList. I can set properties as if
it was am ImageList, etc. But when I try to assign this list of images to
the TreeView control I get an error 'Error: Invalid object'. Has anyone else
had success assigning an image list to a TreeView control?
2) I can't find a persistent way of locating the bitmaps (BMP files) for the
image list (ImageList control). If I do what I have done every client that
accesses the server script needs to have the BMP files in a set location.
How can I persist the BMP files on the server so that I dont' have to keep
them on every client.
Thank you.
Kevin Burton
<P>
<STRONG>
<OBJECT classid="clsid:2C247F23-8591-11D1-B16A-00C0F0283628" id=imlImages
....
</STRONG>
</P>
<P>
<OBJECT classid="clsid:0713E8A2-850A-101B-AFC0-4210102A8DA7"
id=NRCSTreeView ...
</P>
<SCRIPT LANGUAGE=VBScript>
<!--
Dim imgI
Dim imagePath
imagePath = "D:\Local\"
Set imgI = imlImages.ListImages.Add (, "Closed Directory", LoadPicture
(imagePath & "images\closeddir.bmp") )
Set imgI = imlImages.ListImages.Add (, "Open Directory", LoadPicture
(imagePath & "images\opendir.bmp") )
Set imgI = imlImages.ListImages.Add (, "Closed Queue", LoadPicture
(imagePath & "images\closedqueue.bmp") )
Set imgI = imlImages.ListImages.Add (, "Open Queue", LoadPicture
(imagePath & "images\openqueue.bmp") )
Set imgI = imlImages.ListImages.Add (, "Story", LoadPicture (imagePath &
"images\script.bmp") )
Set NRCSTreeView.ImageList = imlImages
Set rootTreeNode = NRCSTreeView.Nodes.Add(, , "<%= rootID %>", "<%=
description %>", "Closed Directory")
//-->