Treeview
-
With the standard treeview when a user right clicks a node to show a context menu the selected item does not change. I want to force this change. Is it possible and if so how? Thanks for any help.
-
With the standard treeview when a user right clicks a node to show a context menu the selected item does not change. I want to force this change. Is it possible and if so how? Thanks for any help.
If there's an event you can catch for the right click, then a tree view has a method for finding the item under the mouse ( assuming it's not passed into the event handler ) and you can select it there. Christian Graus - Microsoft MVP - C++
-
With the standard treeview when a user right clicks a node to show a context menu the selected item does not change. I want to force this change. Is it possible and if so how? Thanks for any help.
You can subscribe to the
MouseDown
event and use the following piece of code.if (e.Button == MouseButtons.Right)
{
TreeNode node = treeView.GetNodeAt(e.X, e.Y);
if (node != null)
treeView.SelectedNode = node;
}Regards Senthil _____________________________ My Blog | My Articles | WinMacro