Right click on a TreeView

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
You need to detect which node was right-clicked - it could be not the
selected one. TreeView.GetNodeAt can help

HTH
Alex
 
Back
Top