We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Adding Menu Items in code

Thread ID:

Created:

Updated:

Platform:

Replies:

4980 Jun 12,2003 08:09 AM Jun 16,2003 06:23 AM Windows Forms 1
loading
Tags: Tools
James
Asked On June 12, 2003 08:09 AM

Hi There, I'm trying to add menu to my main form and am having no luck! Seems like I'm missing a step, but what? int catId = mainMenuManager.Categories.Add("xxxx"); ParentBarItem menuBar = new ParentBarItem(); menuBar.CategoryIndex = catId; menuBar.ID = "zzzz"; menuBar.Text = "test"; mainMenuManager.Items.Add(menuBar); mainMenu.Items.Add(menuBar);

Ramesh Praveen [Syncfusion]
Replied On June 16, 2003 06:23 AM

Hi, A ParentBarItem represents a dropdown submenu (please refer to our User's Guide in Tools\Docs\User's Guide folder) which itself needs to be added to a Bar instance. So, you will have to also do this: Bar mainMenuBar = new Bar(); mainMenuBar.BarStyle = BarStyle.IsMainMenu|...; mainMenuBar.Text = '..."; // This will add an empty main menu bar to your form mainMenuManager.Bars.Add(mainMenuBar); // Then create a new instance of a ParentBarItem as in the code above and add it to your mainMenuBar. mainMenuBar.Items.Add(parentBarItem); Regards, Praveen

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;