I have a TreeView. I am building the nodes within a For/Each loop. I then add icons to each node from an ImageList control. The icons load properly. However I am noticing that when I click onto the nodes, after the TreeView is built, the selected node defaults to another image. It seems to always default to the image which has the index of whatever is set in the Properties Windows for the Control for ImageIndex.
So assume that the ImageIndex is set to 0 in the Properties Window. If I add ImageIndex 1 to the node at run time (See Below), ImageIndex 1 show up but once I click onto this node the icons switches to ImageIndex 0. Why.
Each Treeview Node has an ImageIndex and a SelectedImageIndex set both to the same index number .coding for fun
Be a good forum member mark posts that contain the answers to your questions or those that are helpful
Please format the code in your posts with the button . Makes it easier to read .
Marked As Answer byExcelMonkeyThursday, November 05, 2009 3:26 PM
ok so as I understand it, the TreeView5.ImageIndex = 0 sets the default icon when selected. So I can the question is, how do you set this so that it does not change the icon when selected?
Each Treeview Node has an ImageIndex and a SelectedImageIndex set both to the same index number .coding for fun
Be a good forum member mark posts that contain the answers to your questions or those that are helpful
Please format the code in your posts with the button . Makes it easier to read .
Marked As Answer byExcelMonkeyThursday, November 05, 2009 3:26 PM