Solved

Changing TreeNode Images

Posted on 2006-11-24
4
259 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 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Advice in Xamarin 21 79
VB.NET return row from SQL to DataSet and get column values ? 3 51
Error handling in asp.net site 5 28
MailAddress in vb 4 15
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

778 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