Click here to Skip to main content
15,901,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
In my project I have to create view as per the menu items in brief
Suppose I have menus
File View
-New -ToolBar
-Open -Menu Bar
-Save -Status Bar
- Quick Tabs


Then the tree view design is like
File
-New
-Open
-Save
View
-Tool Bar
-Menu Bar
-Status Bar
-Quick Tabs

How to Do this?
I am not getting MenuItems from the menu. Please Help.
Posted
Updated 4-Mar-11 1:15am
v2
Comments
Albin Abel 4-Mar-11 7:13am    
you need a site map for that

This article explains about sitemap xml with tree view

http://www.15seconds.com/issue/041117.htm[^]
 
Share this answer
 
i Have Used Bellow Code For This

 private void DrawTreeMenu()
  {
    foreach (ToolStripMenuItem t in msMainMenu.Items)
    {
      string mm = t.Text;
      TreeNode tn = new TreeNode(mm);
      tvMenu.Nodes.Add(tn);
      AttachNodeMenu(tvMenu.Nodes[tvMenu.Nodes.Count - 1], t);
    }
  }
  private void AttachNodeMenu(TreeNode tn, ToolStripMenuItem t)
  {
   foreach (ToolStripDropDownItem d in t.DropDownItems)
   {
     string mm = d.Text;
     TreeNode tnc = new TreeNode(mm);
     n.Nodes.Add(tnc);
     AttachNodeMenu(tn.Nodes[tn.Nodes.Count - 1], (ToolStripMenuItem)d);
   }
  }
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900