Can someone walk me through adding a context menu to UltraTreeView Node
I already have a treeview set up
private
void ultraTree_MouseUp(object sender, MouseEventArgs e)
{
ContextMenu contextMenu = new ContextMenu();
if (e.Button == MouseButtons.Right)
This is where I want to add the context meun when I right click, can someone assist me, this will be my first time adding a context menu dynamically
}
First assign a System.Windows.Forms.ContextMenu component to the control's ContextMenu property. Typically you then handle MouseDown for the right button, use GetNodeFromPoint to get a context on the node that was right-clicked, clear the ContextMenu's MenuItems collection and repopulate it as appropriate for that node.
Hi ,
Thanks for responding.
I was trying to add the contextMenu dynamically. I dont see a ContextMenu Property, But I do see a ContextMenuStrip Property.
Question So in order to add a context menu to dynamically , do I still have to drop the ContextMenu control on the form.
Also is there an Ultra ContextMenu control ?