Hello,
I`m using ultratree and if I call context menu by context menu button it opens in реу center of the control.
But I need it to be opened beside the active or selected node.
Any suggestions?
Assuming you are using the System.Windows.Forms.ContextMenu, there is an overload to the Show method that takes the coordinates at which to display the menu.
In order to get the client coordinates of the node at the cursor position, you could do something like this in the MouseDown event handler:
void ultraTree_MouseDown(object sender, MouseEventArgs e){ UltraTree control = sender as UltraTree; UltraTreeNode nodeAtPoint = control.GetNodeFromPoint( e.Location );}
Thanx for quick reply,
But I`m talking about http://en.wikipedia.org/wiki/Menu_key button and could you, please, suggest how to handle that event.
Yes, I`m using class derived from ContextMenu but I can`t override Show method cause it is not virtual.