I want to select a node on right mouse click.
I thoght to do it on mouseclick, but I couldnt find Add, on SelectedNodes.
Hello Drpoalim,
I`m not sure, but maybe you are talking about ActiveNode instead of SelectedNodes. SelectedNodes is collection, so you could have more than one selected nodes. I made small sample which activate a node on right mouse click.
private void ultraTree1_MouseClick(object sender, MouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Right) { ultraTree1.ActiveNode = ultraTree1.GetNodeFromPoint(e.X, e.Y); } }
private void ultraTree1_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
ultraTree1.ActiveNode = ultraTree1.GetNodeFromPoint(e.X, e.Y);
}
Please take a look at the attached sample for more details. Please let me know if you think that I misunderstood your scenario
Regards
The thing that it doesnt color the activenode in blue, and so the user doesnt know that it has been selected.
It just makes a thin frame around the node.
Also I need to show a contextmenu, that show only when the user is right clicking on an item, but not outside an item, and also not on a node that has childre.