Selecting the same node in a TreeView

CodeMonkey

New member
Joined
Jul 25, 2006
Messages
2
Programming Experience
Beginner
Hi all,
Please forgive the stupidity of this question but I am working with Treeviews for the first time. My problem is as follows: When I select a Node in my TreeView I display a form based upon the selected Node (for e.g If I select Customer, the I display the Customer Form). The code for this is in the AfterSelect event and that works fine. But if I try to select the Customer node again (without selecting another node first) my form is not displayed. Can anyone please tell me what event I should be putting my code in so that I can determine the currently selected node to display my forms, but still be able to select the same node as many times in a row as I like.

Thanks in advance for your help.
 
Just a few comments that may help.

1. Remember a node can be clicked or double clicked and its probably
best to use the double click because it sets it harder. ( for lack
of a better word)

Private Sub TreeView1_DoubleClick(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles TreeView1.DoubleClick

dim CurNodeText as string = TreeView1.SelectedNode.Text
Node = CurNodeText

I think of single clicks as highlights in preperation for a right click or
drag.


Treeviews are fun, you can color code them for different types of
forms and even cooler with black backgrounds with nice fonts.

Its been awhile since I worked with them so let me know if this
doesn't help and I will check better.
 
Back
Top