private void GetControlByName() { for (int i = 0; i < this.menuStrip1.Items.Count; i++) { string mnuItemName = this.menuStrip1.Items[i].Text; Tree.Nodes.Add("", mnuItemName, 0, 2); ToolStripMenuItem tmpMenuItem = this.menuStrip1.Items[i] as ToolStripMenuItem; for (int j = 0; j < tmpMenuItem.DropDownItems.Count; j++) { string menuSubItem = tmpMenuItem.DropDownItems[j].Text; if (menuSubItem != "") { Tree.Nodes[i].Nodes.Add("", menuSubItem, 1, 2); } } } Tree.ExpandAll(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)