submenu

0
0

please help, how to syntax or code to add sub menus dynamically through a code?

  • You must to post comments
0
0

Ok, Thank you

  • You must to post comments
0
0

Hi Rudy,

I presume you are referring to a MenuBar. If you use the Visual Studo designer to build a menu, you will get the code you want on the *.Designer.cs file.

Anyway a MenuItem has a MenuItems property that is a collection of all sub-items, more precisely, a MenuItem[]. All you have to do is to add a MenuItem to the MenuItems collection like this

Snippet

this.myMenuItem.MenuItems.Add(this.myMenuSubItem);

 

  • rudy lau
    Ok, Thank You mr. Tiago
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.