TreeView - change selected Item before Contextmenu opens

  • Thread starter Thread starter LinusHechinger
  • Start date Start date
L

LinusHechinger

Hello,

I've got a problem,
made a treeview in a nice app, and a contextmenustrip attached to.

When i use rightclick to open the contextmenu,
an a item is selected - it still remains selected,
and not the item under the mouse. to which i want to
use the context-items....

how to switch the selected item before context menu opens ??
 
LinusHechinger said:
Hello,

I've got a problem,
made a treeview in a nice app, and a contextmenustrip attached to.

When i use rightclick to open the contextmenu,
an a item is selected - it still remains selected,
and not the item under the mouse. to which i want to
use the context-items....

how to switch the selected item before context menu opens ??

Handle the MouseDown event. Select the item under the mouse
if the right button has been pressed. Call the TVW's GetNodeAt
method to determine the node to be selected.
 
Back
Top