现在有两个TMainMenu:menu1、menu2
怎么合并成一个TMainMenu,比如合并到menu1中,该怎么做呀

解决方案 »

  1.   

    但我试过menu1.Merge(menu2);变成替换,
    menu1菜单中内容不见了
      

  2.   

    我想实现这样:  TfrmConsole = Class(TForm)
        MainMenu : TMainMenu ; //主菜单
        procedure InsertMenu(AMenu: TMainMenu; AIndex : Integer) ;  //MainMenu.Items[AIndex]处插入AMenu菜单
      end ;
    -----InsertMenu里该怎么写?
      

  3.   

    Depending on the value of the GroupIndex property of menu items on the main menu, the merged menu items can replace menu items on the menu bar, or insert menu items into the menu bar. See GroupIndex for information on how to do these things.看帮助, 你需要设置 GroupIndex 就能达到是插入,还是取代原来的菜单
      

  4.   

    By default, all menu items in a menu bar (main menu) have the same GroupIndex value. To use GroupIndex to merge menus, set the GroupIndex value of each successive menu item to a value equal to or greater than that of the previous menu item.
      

  5.   

    Merge只能合并两个菜单吗?
    设置GroupIndex后,合并一个MainMenu没问题,再次合并另一个MainMenu时就达不到目的了。