Transfer from http://www.cnblogs.com/luluping/archive/2010/03/03/1677206.html
(1) To add a TreeView control to the form
(2) Add a ContextMenuStrip control again;
(3) To add a MouseDown event to the TreeView, the code is as follows:
Private void treeview1_mousedown (object sender, mouseeventargs e)     &NBSP, ..... { if (e.Button == Mousebuttons.right)//Judge you point is not right button { point Clickpoint = new point (E.X, E.Y); treenode currentnode = treeview1.getnodeat (ClickPoint ); if ( Currentnode != null)//Judging you dot is not a node     &NBSP, ..... { switch (currentnode.name)//depending on the node display different right-click menu, of course, you can let it display the same menu  &NBSP, ..... { case "Errorurl": CurrentNode.ContextMenuStrip = contextMenuStripErrorUrl; break; } treeview1.selectednode = currentnode;//Select this node } } }
C # WinForm TreeView node Add right-click menu and select Node