Dynamically adding ToolStripMenuItems to a MenuStrip (C#/ Winforms)

后端 未结 4 1596
小蘑菇
小蘑菇 2021-02-18 18:53

I have my solution implemented (basic solution) and I\'m happy.

Problem is when I add new items to a ToolStripItemCollection using the \'Add\' method, I get a few overl

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-18 19:42

    What is wrong with:

    ToolStripItem item = toolStripItems.Add("MyItem");
    item.Click += new EventHandler(....);
    

    Am I missing something?

提交回复
热议问题