I want to select a node on right mouse click.
I thoght to do it on mouseclick, but I couldnt find Add, on SelectedNodes.
Hi,
Have you been able to resolve your issue ? Did you have a time to take a look at the attached sample. Let me know if you have anyquestions.
Regards
Hello,
Maybe one possible way to achieve desired behavior could be if you handle MouseDown and MouseUp events and include the code that apply Context menu and change node`s appearance. Please take a look at the attached sample for more details and let me know if you have any questions.
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.
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