用MainMenu.MenuItems.Add方法可以增加菜单啊private void InitializeMyMainMenu()
{
   // Create the MainMenu and the MenuItem to add.
   MainMenu mainMenu1 = new MainMenu();
   MenuItem menuItem1 = new MenuItem("&File");
   
   /* Use the MenuItems property to call the Add method
0A      to add the MenuItem to the MainMenu menu item collection. */
   mainMenu1.MenuItems.Add (menuItem1);   // Assign mainMenu1 to the form.
   this.Menu = mainMenu1;
}

解决方案 »

  1.   

    照aimstrong(今生今世)给的例子不就行了
      

  2.   

    对阿,你就依次new一个MenuItem对象,然后用MainMenu.MenuItems.Add方法加不就行了,有问题吗?
      

  3.   

    呵呵,对呀
    从配置文件中读出来数据一个一个加
    ----------------------------------------
    欢迎光临:C#资源网
    http://csource.yeah.net
      

  4.   

    但是我增加多个的时候只能显示一个,并且这个的text是空的。
      

  5.   

    感谢您使用微软产品。您可以通过Menu.MenuItemCollection.Add方法来动态的增加菜单。该方法的具体使用方法请参阅MSDN:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsmenumenuitemcollectionclassaddtopic.asp在上面的链接中给出了一个简单的示例。您还可以在MSDN中找到一个更详尽的示例:
    http://samples.gotdotnet.com/quickstart/aspplus/default.aspx?url=/quickstart/winforms/doc/WinFormsMenus.aspx
    - 微软全球技术中心 VC技术支持本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款
    (http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。
    为了为您创建更好的讨论环境,请参加我们的用户满意度调查
    (http://support.microsoft.com/directory/worldwide/zh-cn/community/survey.asp?key=(S,49854782))。