Treenode and ContextMenuStrip

  • Thread starter Thread starter Nader
  • Start date Start date
N

Nader

Hi,
I have a Contextmenustrip which is attached to all treenodes in my
treeview.

After selecting an Item from the contextmenustrip, how can I find out
which treenode was linked to the menustrip?

ContextMenuStrip.SourceControl returns data about the treeview!!!
 
After selecting an Item from the contextmenustrip, how can I find out
which treenode was linked to the menustrip?

ContextMenuStrip.SourceControl returns data about the treeview!!!

And the TreeView has the SelectedItem property. And if the node was not
selected before the context menu has appeared then you should select it
first. And if you don't want to do this then you might use the method
TreeView.GetNodeAt(...)
 
Back
Top