Treenode and ContextMenuStrip

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!!!
 
R

Robert Schneider

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(...)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top