How to add submenu items to menuitems

后端 未结 4 971
旧巷少年郎
旧巷少年郎 2021-01-02 09:33

I have created a Table layout in windows forms as shown in figure, i have added a right mouse button click Menu to my table,

i wnt to add submenu items to following

4条回答
  •  一整个雨季
    2021-01-02 10:08

    That format doesn't work for me. I'm forced to use:

    // People often exclude the applicable "using" statements--so samples don't work!
    using System.Web.UI.WebControls; 
    
    // Create the MAIN menu item
    MenuItem mnuMenuItem = new MenuItem();         
    
    // Create the SUB menu item
    MenuItem mnuSubMenuItem = new MenuItem();      
    
    // Create the SUB menu item, "under" the MAIN menu item!
    mnuMenuItem.ChildItems.Add(mnuSubMenuItem);  
    

提交回复
热议问题