05-07-2001, 05:59 PM
I'm trying to use an imagelist to display an icon for each node in a treeview. I can load the treeview with the images fine, but they are all the same image, index 1. and when I go back to dev and look at my imagelist, they are all the same image as image 1. I am loading 6 different images, but they are all becoming the same one. The images are all the same size.
any help here appreciated.
05-08-2001, 07:32 AM
It is not true that you are "loading 6 different images, but they are all
becoming the same one." When you "load" you actually click the
"Insert Picture" button, and you always see all images during
the time you "insert" them one by one. If you use the word
"Load" and "go back" you are doing wrongly.
The correct words are "insert picture"
and "always seeing them in the mean time."
It is true, however, they must be the same size,
for Microsoft Online Help said so.
AnhMy_Tran<P ID="edit"><FONT class="small"><EM>Edited by anhmytran on 05/08/01 08:34 AM.</EM></FONT></P>
05-08-2001, 10:06 AM
ok, so I am inserting 6 different pictures but they are all becoming the first one as soon as my program makes a call to the treeview using the imagelist. any ideas why?
(when I return to development and view the pictures in the imagelist, they are all the same)
05-08-2001, 11:25 AM
So to be clear, you are loading the pictures in the IDE environment by setting the imagelist properties? And at this time, you can see that all the images are different?
But when you run the program, all the images change? And when you stop the program and get back to the IDE, you see all the images are the same?
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
05-08-2001, 11:25 AM
TreeView1.ImageList = ImageList1
.Nodes.Add , , "T", "ATran", 1, 2
.Nodes.Add "Relative", tvwChild, "ItsOwnKey", "Image1Key", "Image2Key"
.Nodes.Add "Relative", tvwChild, "ItsOwnKey", 3, 4
ItsOwnKey is the String to specify the Rank in the Relationship between Nodes.
ImageKey is the String you enter in the KEY in the Image Box Property
Number is the INDEX when you Insert Picture in the Image Box Property.
You can use either of them. When they are identical, the image is also identical.
Please, check your code to see if they are different?
05-09-2001, 07:03 AM
I changed my treeview properties to no imagelist and then set the imagelist in the code and everything worked fine. Go figure, but thanks for the help.
05-09-2001, 07:35 AM
I do not understand what you said and what you have done.
I am sorry that I cannot help you in a very small matter like that.
Have a nice day.
05-09-2001, 07:46 AM
don't worry my friend, you have already helped me and I have my treeview working fine now, thank you