By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,524 Members | 1,475 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,524 IT Pros & Developers. It's quick & easy.

TreeView question

P: n/a
In a TreeView when a new node is selected I don't know how to change the
icon of the node that is now no longer selected.

Seems BeforeSelection and AfterSelection events tell only which node is now
selected.
Any suggestions??
Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
>In a TreeView when a new node is selected I don't know how to change the
icon of the node that is now no longer selected.

Seems BeforeSelection and AfterSelection events tell only which node is now
selected.


Not really looked at these events, but how about having a variable in
the form class that stores the node. This node can be checked in the
SelectedIndexChanged event of the Treeview, modified and then set to
the newly selected node.

Hope this makes sense

Blu
Nov 20 '05 #2

P: n/a
* " Just Me" <ne********@a-znet.com> scripsit:
In a TreeView when a new node is selected I don't know how to change the
icon of the node that is now no longer selected.

Seems BeforeSelection and AfterSelection events tell only which node is now
selected.


Add a handler to the treeview's 'BeforeSelect' event and check the
treeview's 'SelectedNode' property. This property will contain a
reference to the selected node before the new note is selected.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3

P: n/a
I had thought of that but all kinds of things could happen between saving it
and using it. I'm sure I could make this work - if I have to.

Thanks a lot
"BluDog" <ne**@nospam.bludog.net> wrote in message
news:a7********************************@4ax.com...
In a TreeView when a new node is selected I don't know how to change the
icon of the node that is now no longer selected.

Seems BeforeSelection and AfterSelection events tell only which node is nowselected.


Not really looked at these events, but how about having a variable in
the form class that stores the node. This node can be checked in the
SelectedIndexChanged event of the Treeview, modified and then set to
the newly selected node.

Hope this makes sense

Blu

Nov 20 '05 #4

P: n/a

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
* " Just Me" <ne********@a-znet.com> scripsit:
In a TreeView when a new node is selected I don't know how to change the
icon of the node that is now no longer selected.

Seems BeforeSelection and AfterSelection events tell only which node is now selected.
Add a handler to the treeview's 'BeforeSelect' event and check the


I did try this but checked the contents of "e".
Guess I didn't see that there was a SelectedNode property.

THANKS
treeview's 'SelectedNode' property. This property will contain a
reference to the selected node before the new note is selected.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #5

P: n/a
* " Just Me" <ne********@a-znet.com> scripsit:
In a TreeView when a new node is selected I don't know how to change the
icon of the node that is now no longer selected.

Seems BeforeSelection and AfterSelection events tell only which node is now
selected.


Add a handler to the treeview's 'BeforeSelect' event and check the


I did try this but checked the contents of "e".
Guess I didn't see that there was a SelectedNode property.


'e.Node' will hold a reference to the node that /will be/ selected ;-).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.