Solved

Changing TreeNode Images

Posted on 2006-11-24
4
261 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 500 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

Suggested Solutions

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

756 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