MenuStrip菜單加載問題
我現在想動態加載菜單
請教怎么做
menumain.Items.Clear();
ToolStripMenuItem menutola = new ToolStripMenuItem();
ToolStripMenuItem menutol1 = new ToolStripMenuItem();
ToolStripMenuItem menutol2 = new ToolStripMenuItem();
ToolStripMenuItem menuto3 = new ToolStripMenuItem();
ToolStripMenuItem menutol4 = new ToolStripMenuItem();
ToolStripMenuItem menutol5 = new ToolStripMenuItem();
for (int i = 0; i <= arrary.GetUpperBound(0); i++)
{
if (arrary[i, 1] == " " || arrary[i, 1] == null)
{ }
else
{
System.Windows.Forms.TreeNode tn = new System.Windows.Forms.TreeNode(arrary[i, 1]);
tn.Tag = arrary[i, 0];//菜單代碼 arrary[i, 1]名稱 arrary[i, 2]級別
//menutola.Text = "JokevinHr ";
//menumain.Items.Add(menutola);
switch(arrary[i,2])
{
case "1 ":
menutol1 = menutola;