Advertisement

01.24.2007 at 08:20AM PST, ID: 22134941
[x]
Attachment Details

treeview selectednode no icon change

Asked by ullfindsmit in .Net Class Libraries, Microsoft Visual Basic.Net, Windows Forms for .Net

Tags: treeview, change, node, icon

I have a simple treeview which shows folders and files
I have three icons in my imagelist
folderclosed
file
folderopen

i set the imageindex when the nodes are added
imageindex =1 for file and 0 for folders

i have two seperate tree views
tvMain
and tvSource
here is how I am trying it currently
    Private Sub tvMain_AfterSelect(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles tvMain.AfterSelect
        tvMain.SelectedImageIndex = tvMain.SelectedNode.ImageIndex
    End Sub
The code above... cause the tree to collapse for some reason... so its NO GOOD unless you can find a solution for that

    Private Sub tvSource_AfterSelect(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles tvSource.AfterSelect
        e.Node.ImageIndex = tvSource.SelectedNode.ImageIndex
    End Sub
the above code does not do anything...

is there a way I can disable auto changing of imageindex... and manually handle events and do it accordingly ?

help appreciated
-Smit.Start Free Trial
 
Loading Advertisement...
 
[+][-]01.24.2007 at 11:48AM PST, ID: 18389267

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.24.2007 at 01:19PM PST, ID: 18390223

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.05.2007 at 02:14PM PST, ID: 18471899

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.26.2007 at 09:04PM PST, ID: 18614824

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]03.02.2007 at 11:39PM PST, ID: 18646360

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .Net Class Libraries, Microsoft Visual Basic.Net, Windows Forms for .Net
Tags: treeview, change, node, icon
Sign Up Now!
Solution Provided By: Netminder
Participating Experts: 2
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32