IMenu fileMenu = mainMenu.AddSubMenu("File"); fileMenu.AddItem("New"); fileMenu.AddItem("Open"); fileMenu.AddItem("Save"); fileMenu.AddSeparator(); fileMenu.AddItem("Exit");
IMenu helpMenu = mainMenu.AddSubMenu("Help"); IMenu aboutMenu = helpMenu.AddSubMenu("About"); aboutMenu.AddItem("Version"); aboutMenu.AddItem("Credits"); helpMenu.AddSeparator(); helpMenu.AddItem("Help Topics"); helpMenu.AddItem("Contact Us");This code creates a new sub-menu called "Help" and adds it to an existing main menu. It then adds a nested sub-menu called "About" with items such as "Version" and "Credits". Finally, it adds additional items to the main "Help" sub-menu, such as "Help Topics" and "Contact Us".