private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
treeView1.SelectedNode = e.Node;
//isn't root
if (e.Node.Name.Length > 0)
{
//disable clone tree on nodes with no children
cloneTreeToolStripMenuItem.Enabled = e.Node.Nodes.Count != 0;
nodeContextMenuStrip1.Show(MousePosition);
}
}
}