Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TreeView Context menu

Status
Not open for further replies.

KoRUPT

Programmer
Jul 25, 2002
25
0
0
CA
This one has got me in a pickle. I have a context menu assigned to a treeview on a form. When I bring up the context menu overtop of a node, it selects the node and shows the menu. Unfortunatly, I cannot find which node is selected progmatically.

Can someone help me out please?

Thanks.
 
Well what i have done is to over-ride the mouseDown event and show the context menu if right mouse button is clicked. In this case i can use getNodeAt() member function of the treeview to get the selected node. Ofcourse i am doing this because i need to show different context menus depending on the node clicked.

Hope this helps.
 
Hi,
You can cast your System.Windows.Forms.TreeViewEventArgs e
to (NxNodeComment) e.Node) and get the object connected to the node.

Bye

Mau
 
GetNodeAt() is what I needed. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top