public void getSonMenus(ToolStripItem item, string pName, ref string strSQL) { MenuBLL bll = new MenuBLL(); ToolStripMenuItem tItem = (ToolStripMenuItem)item; tItem.Enabled = true; strSQL = strSQL + "'" + tItem.Name + "',"; bll.addMenu(tItem.Text, pName, tItem.Name); if (tItem.DropDownItems.Count > 0) { foreach (ToolStripItem titem in tItem.DropDownItems) { ToolStripMenuItem toolMenu = (ToolStripMenuItem)titem; getSonMenus(toolMenu, tItem.Name, ref strSQL); } } }
public void GetMenus() { MenuBLL mbll = new MenuBLL(); string strSQL = ""; foreach (ToolStripItem item in msMainMenu.Items) { getSonMenus(item, "", ref strSQL); } mbll.deleteMenu(strSQL); }