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.
Syncfusion Feedback

Adding new menu item to already merged menus.

Thread ID:

Created:

Updated:

Platform:

Replies:

19932 Oct 6,2004 11:27 AM Oct 6,2004 02:27 PM Windows Forms 2
loading
Tags: Tools
Andrew Skalkin
Asked On October 6, 2004 11:27 AM

Hello, I can''t figure out how to properly dynamically add main form''s top-level menu items in my MDI application. The problem would be best demonstrated with the example below: public MainForm() { InitializeComponent(); mainFrameBarManager.RegisterMdiChildTypes(new Type[] {typeof(View)}); // now, I want to dynamically add main form''s top-level menu. // the following code produces no effect if it is executed after the call to RegisterMdiChildTypes. ParentBarItem pbi = new ParentBarItem(); mainFrameBarManager.Items.Add(pbi); mainMenu.Items.Insert(mainMenu.Items.Count - 1, pbi); }

Andrew Skalkin
Replied On October 6, 2004 11:40 AM

The (ugly) way around the problem is creating a number of dummy invisible menu items before the call to RegisterMdiChildTypes and reusing them when needed... This is what I do at the moment but it seriously hurts my aestethic feelings :)

Administrator [Syncfusion]
Replied On October 6, 2004 02:27 PM

Hi Andrew, In a MDI scenario, you should always add the BarItems to the merged Bar''s Items collection and not to the original Bar''s Items collection as shown in code below : this.mainFrameBarManager1.GetMergedEquivalent(this.bar1, this.bar1).Items.Add(pbitem); Please refer to the test sample that illustrates this and let me know if it helps. Regards, Guru Patwal Syncfusion,Inc.

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.

Warning Icon 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.Close Icon

;