Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Treeview nodes images

Status
Not open for further replies.

cmwebmast

IS-IT--Management
Jun 14, 2002
1
MT
Hi,

I want to change the image of a node by double clicking on it, and then change it back to the original image by bouble clicking on another node, which cuases the image of the latter node to chnage........and so on.

Any ideas ?
 
First problem is getting by the fact that the Treeview control does not have a NodeDblClick event exposed.

You can probably use the NodeClick event to store the current node clicked on, on the DoubleClick event you can do the work(maybe in the control.tag property).

Check the tag for existing node
If tag not blank then reset tht node's icon
Set the new icon

This is a hack; you might want to look for a treeview wrapper that someone might have written. There is a real good one at...
 
When you set up a node you give it two image indexes, one for when the node is selected and one when not selected.

try this from MSDN:
object.Add(relative, relationship, key, text, image, selectedimage)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top