I have treeview and a context menu that is shown for every node.
One node has the selection. I move now with the mouse to another node and open the context menu with a righ-mouse-click. Now there is the problem, that the selection is still on the old new node.
How can I prevent, that the menu pops up, if the user haven’t selected the node before by a mouse click selection ? In other words how can I achieve that the user must select the treenode before by a normal mouse click or the treenode gets the selection with the right mouse click automatically.
I have treeview and a context menu that is shown for every node. One
Share
Try the following code, which provides you a preselection of the treenode.