主题:求助 无限级菜单
想在VS2005下做个数据库无限级菜单,当处于终极时,才附加委托事件,请高手帮忙!
代码类似:
ToolStripMenuItem[] Parent = new ToolStripMenuItem[2];
Parent[0] = new ToolStripMenuItem("系统管理", null, null, "System");
Parent[1] = new ToolStripMenuItem("产品管理", null, new System.EventHandler(Menu_Click), "Product");
ToolStripMenuItem[] Child = new ToolStripMenuItem[2];
Child[0] = new ToolStripMenuItem("系统设置", null, null, "Set");
Child[1] = new ToolStripMenuItem("会员管理", null, new System.EventHandler(Menu_Click), "Member");
ToolStripMenuItem[] Third = new ToolStripMenuItem[2];
Third[0] = new ToolStripMenuItem("配置文件", null, new System.EventHandler(Menu_Click), "Set");
Third[1] = new ToolStripMenuItem("配置文件", null, new System.EventHandler(Menu_Click), "Set");
Child[0].DropDownItems.AddRange(Third);
Parent[0].DropDownItems.AddRange(Child);
MainMenu.Items.AddRange(Parent);
代码类似:
ToolStripMenuItem[] Parent = new ToolStripMenuItem[2];
Parent[0] = new ToolStripMenuItem("系统管理", null, null, "System");
Parent[1] = new ToolStripMenuItem("产品管理", null, new System.EventHandler(Menu_Click), "Product");
ToolStripMenuItem[] Child = new ToolStripMenuItem[2];
Child[0] = new ToolStripMenuItem("系统设置", null, null, "Set");
Child[1] = new ToolStripMenuItem("会员管理", null, new System.EventHandler(Menu_Click), "Member");
ToolStripMenuItem[] Third = new ToolStripMenuItem[2];
Third[0] = new ToolStripMenuItem("配置文件", null, new System.EventHandler(Menu_Click), "Set");
Third[1] = new ToolStripMenuItem("配置文件", null, new System.EventHandler(Menu_Click), "Set");
Child[0].DropDownItems.AddRange(Third);
Parent[0].DropDownItems.AddRange(Child);
MainMenu.Items.AddRange(Parent);