TreeView Help
-
The problem I have is that I want some icons to be changed...When I expand a Node I want for it another icon then the default when I click a Node that does not have subNodes I want another icon for it, I have tried but it wont work when I expand the node the icon appears somewhere else... Pls help... And how can I make the right click of mouse to select a TreeNode like the left click.. PS:English is not my native language so pls excuse me! (o)(o)
-
The problem I have is that I want some icons to be changed...When I expand a Node I want for it another icon then the default when I click a Node that does not have subNodes I want another icon for it, I have tried but it wont work when I expand the node the icon appears somewhere else... Pls help... And how can I make the right click of mouse to select a TreeNode like the left click.. PS:English is not my native language so pls excuse me! (o)(o)
1. Use GetTreeCtrl() to work with the CTreeCtrl object. I assume you used already the CTreeCtrl::SetImageList() function. Now use the CTrreCtrl::SetItem() function where you specify the wanted number values for the nImage and nSelectedImage parameters. 2. Derive a class form CTreeCtrl (let it be CMyTreeCtrl), change your object declaration from: CTreeCtrl m_MyTree; into CMyTreeCtrl m_MyTree (or whatever you have there :-)). Now you can use the wizard to add a handler for the right click event (and a lot of other events). Spe sa te ajute :-)) SkyWalker
-
1. Use GetTreeCtrl() to work with the CTreeCtrl object. I assume you used already the CTreeCtrl::SetImageList() function. Now use the CTrreCtrl::SetItem() function where you specify the wanted number values for the nImage and nSelectedImage parameters. 2. Derive a class form CTreeCtrl (let it be CMyTreeCtrl), change your object declaration from: CTreeCtrl m_MyTree; into CMyTreeCtrl m_MyTree (or whatever you have there :-)). Now you can use the wizard to add a handler for the right click event (and a lot of other events). Spe sa te ajute :-)) SkyWalker