Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Changing TreeNode Images

Posted on 2006-11-24
4
Medium Priority
?
269 Views
Last Modified: 2010-04-23
hi

i have a TreeView that contains various TreeNodes

i have set the ImageIndex to a closed folder image, and the SelectedImageIndex to an open folder image.

this works fine when i double click the treenode, the images swap around... BUT when I use the expan/collapse feature of the TreeView (ie the + and - icons), the images don't change...

any ideas?

cheers,
0
Comment
Question by:A4eIT
4 Comments
 
LVL 6

Expert Comment

by:manch
ID: 18006757

Actually when u expand or collapse the Tree View Nodes the Node is not Selected so the SelectedImageIndex won't work for that

SelectedImageIndex is basically when the node is selected then the image is displayed

(Try to select the Node u want it will work fine u have to find the Index of the Node and then set the SelectedNode property of the TreeView to that paritcular node)

Try it
0
 

Author Comment

by:A4eIT
ID: 18006857
many thanks

please could you advise me how to do that? what event fires when i click on the '+' or '-'?

thx
0
 
LVL 8

Expert Comment

by:doraiswamy
ID: 18007237
When you click +, the 'beforeexpand' event fires, the nodes expand and then the 'afterexpand' event fires. Similarly, the - has 'beforecollapse' and 'aftercollapse' events.
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 2000 total points
ID: 18007658
Hi A4eIT,

I have written an article on that in April 2006 that you can read from http://emoreau.s2i.com/

Cheers!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question