Robin V. Robin V. - 5 months ago 66
C# Question

Get treenode from contextmenu-item eventHandler

I've got a treeview with several treenodes. When I right-click a treenode i get a contextmenu
with different options, for example 'delete item'.

Is there a simple way to get the treenode object, that was right-clicked, in the eventHandler of the contextmenu-item ?


If you (right)click a node, doesn't it become the selected node?

TreeNode needed = TreeViewX.SelectedNode;