hello everybody!! iam generating a windows form which has a treeview at the left and a splitpanel at its right. the treeview consists of 3 parent nodes with 1 child node in each parent node. the parent nodes have a contextmenu with "Start" and "Stop" as menu items and child nodes have a contextmenu with "Properties" as menuitem. each of the menuitem has an OnClick event handler. what i want is, on clicking the menuitem of each of the child nodes, a different panel should be displayed each time. for this, i need to have 3 panels, one for each childnode. when one panel is being displayed, others should be hidden. my requirement is something similar to the WindowsExplorer, but iam not able to generate the desired o/p. Also, when i right-click on any of the node, the contextmenu is displayed, but after clicking the desired menuitem, the contextmenu just doesnt disappear. am i missing some property tat has to be set for the contextmenu to disappear after selecting a menuitem? this is a part of my code: mnuParentMenu.MenuItems.Add(0, new MenuItem("Start", new System.EventHandler(mnuStart_Click))); mnuParentMenu.MenuItems.Add(1, new MenuItem("Stop", new System.EventHandler(mnuStop_Click))); mnuChildMenu.MenuItems.Add(0, = new MenuItem("Properties", new System.EventHandler(mnuPropertiesC_Click))); TreeNode node = new TreeNode("Parent"); node.Tag = "ParentNodeMenu"; node.ContextMenu = mnuParentMenu; treeView1.Nodes.Add(node); node = new TreeNode("Child"); node.Tag = "ChildNodeMenu"; node.ContextMenu = mnuChildMenu; treeView1.Nodes[0].Nodes.Add(node);
I would be thankful to all who wish to take some time and help me out.
Sonu