Here's what I'm doing to make the right context mnue show up based on
what node was cliked:
private void tvwMenu_MouseUp(object sender, MouseEventArgs e)
{
//Select Node When Right Clicked & Set Context Menu To Use
if( e.Button == MouseButtons.Right )
{
TreeNode node = tvwMenu.GetNodeAt( new Point( e.X, e.Y ) );
if( node != null )
{
TreeNodeMenuTag tag = (TreeNodeMenuTag)node.Tag;
tvwMenu.SelectedNode = node;
tvwMenu.ContextMenuStrip = (tag.isMenu) ? cmnuMenuNode :
cmnuProgramNode;
}
}
}
It works, but unlike the Solution Explorer treeview in VS when you
right click on a node the node loses its highlight. I don't like this
cux it makes it less obvious which node you are operating on. Anyone
know how to fix this?
Thanks.