 |

05-07-2001, 05:59 PM
|
|
|
Using imagelists with Treeviews
|
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
|
|
Senior Contributor
Retired Moderator * Guru *
|
|
Join Date: Aug 1999
Location: Hartford, Connecticut, 06
Posts: 1,487
|
|
Re: Using imagelists with Treeviews
|
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
|
|
|
Re: Using imagelists with Treeviews
|
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
|
 |
Code Meister
Retired Moderator * Guru *
|
|
Join Date: Aug 2000
Location: Vancouver, BC, Canada
Posts: 10,441
|
|
Re: Using imagelists with Treeviews
|
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
|
__________________
"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
|
|
Senior Contributor
Retired Moderator * Guru *
|
|
Join Date: Aug 1999
Location: Hartford, Connecticut, 06
Posts: 1,487
|
|
Re: Using imagelists with Treeviews
|
TreeView1.ImageList = ImageList1
With TreeView1
.Nodes.Add , , "T", "ATran", 1, 2
.Nodes.Add "Relative", tvwChild, "ItsOwnKey", "Image1Key", "Image2Key"
.Nodes.Add "Relative", tvwChild, "ItsOwnKey", 3, 4
End With
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?
AnhMy_Tran
|
|

05-09-2001, 07:03 AM
|
|
|
Re: Using imagelists with Treeviews
|
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
|
|
Senior Contributor
Retired Moderator * Guru *
|
|
Join Date: Aug 1999
Location: Hartford, Connecticut, 06
Posts: 1,487
|
|
Re: Using imagelists with Treeviews
|
Dear:
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.
AnhMy_Tran
|
|

05-09-2001, 07:46 AM
|
|
|
Re: Using imagelists with Treeviews
|
don't worry my friend, you have already helped me and I have my treeview working fine now, thank you
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|