Selecting a tree node??
-
Good evening truly people, With all due respect, may I know how HOW THE HELL do I get a node selected using the right mouse button and then show the context menu.. I'm trying this
private void tree_Level_MouseDown(object sender, MouseEventArgs e)
{
tree_Level1.GetChildAtPoint(tree_Level.PointToClient(new Point(e.X, e.Y)).Select();
}Then I managed to show the context menu but once that happens, it goes back and selects the old node:confused:
Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)
-
Good evening truly people, With all due respect, may I know how HOW THE HELL do I get a node selected using the right mouse button and then show the context menu.. I'm trying this
private void tree_Level_MouseDown(object sender, MouseEventArgs e)
{
tree_Level1.GetChildAtPoint(tree_Level.PointToClient(new Point(e.X, e.Y)).Select();
}Then I managed to show the context menu but once that happens, it goes back and selects the old node:confused:
Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)
Use the
AfterSelect
event instead.Deja View - the feeling that you've seen this post before.
-
Use the
AfterSelect
event instead.Deja View - the feeling that you've seen this post before.
Hi Pete and thanks for the help.. Actually, it was already in the AfterSelect event and I had to move it to obtain the mouse location value form the passed arguments. If you tried to run the piece of code I just pasted, it will simply not work anywhere not just out of the AfterSelect event!
Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)
-
Good evening truly people, With all due respect, may I know how HOW THE HELL do I get a node selected using the right mouse button and then show the context menu.. I'm trying this
private void tree_Level_MouseDown(object sender, MouseEventArgs e)
{
tree_Level1.GetChildAtPoint(tree_Level.PointToClient(new Point(e.X, e.Y)).Select();
}Then I managed to show the context menu but once that happens, it goes back and selects the old node:confused:
Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)
-
Hey! Thanx a bunch buddy, that was a great help!
Smile: A curve that can set a lot of things straight! (\ /) (O.o) (><)