Right click on a TreeView

G

Guest

Hi everybody,

I've got a TreeView and when ever I right-click on it, the ContextMenuStrip
should comes up. The problem is the following, if the user didn't left-click
an then right click the node he or she desired, the ContextMenuStrip will
show the options for the node that was left-clicked before. How can I make it
work like explorer does that it doesn't need to be left-clicked and then
right -clicked?

I will appreciate if you can direct me to some information relevant to this
or answer my question.

Thanks,

humble.apprentice
 
A

AlexS

You need to detect which node was right-clicked - it could be not the
selected one. TreeView.GetNodeAt can help

HTH
Alex
 

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