Select TreeNode on Right-Click

  • Thread starter Thread starter paradox
  • Start date Start date
P

paradox

How can I go about having a TreeNode selected when I right click? I
tried using the Click event, but the event does not pass in the node
that was clicked.

Currently you have to left click a node in order to select it. I want
to be able to write click and bring up a context menu with only certain
options available depending on the node selected. I got the context
menu to come up (which is very easy to do), however, you first have to
left click and then right click on a Node in order to have the context
menu pay attention to the node your right clicking on. Any help would
be most appreciated. Thanks.
 
Add an event handler to the MouseDown event.
You can then use the GetNodeAt() method to set the SelectedNode propery of
the TreeView

Chris
 
Back
Top