示例#1
0
        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);
                }
            }
        }
示例#2
0
 public void GetMenus()
 {
     MenuBLL mbll = new MenuBLL();
     string strSQL = "";
     foreach (ToolStripItem item in msMainMenu.Items)
     {
         getSonMenus(item, "", ref strSQL);
     }
     mbll.deleteMenu(strSQL);
 }