mainMenu1.MenuItems.Add(y1, cdmc1[i]);
cdmc1[i].Click += new EventHandler(this.menuItem1_Click);
}
//添加二级菜单项
for (int i = 0; i <= x2 - 1; i++)
{
lc_cdbm1 = cdbm2[i].Substring(0, 1);
lc_cdbm2 = cdbm2[i].Substring(1, 1);
oper.Test(lc_cdbm2, out ln_test);
if (ln_test == 1)
{
ln_zim = oper.myViews.Find(lc_cdbm2);
y2 = int.Parse(oper.myViews[ln_zim]["xuhao"].ToString());
}
else
{
y2 = int.Parse(cdbm2[i].Substring(1, 1));
}
for (int j = 0; j <= x1 - 1; j++)
{
if (lc_cdbm1 == cdbm1[j].ToString())
{
if (cdbj2[i] == 0)
{
cdmc2[i].Visible = false;
cdmc2[i].Enabled = false;
}
cdmc1[j].MenuItems.Add(y2, cdmc2[i]);
cdmc2[i].Click += new EventHandler(this.menuItem1_Click);
} }
|