My application is not an mdi application. The container is not an mdi container but a simple panel. The main form use a MainFrameBarManager and the child forms use ChildFrameBarManager.
I want to merge the menus & toolbars when a child form is shown and clear this menus when it closed. I want to obtain the behavior of an mdi application for merging.
How can i do this ?
ADAdministrator Syncfusion Team June 16, 2005 05:38 PM
Unfortunately the XPMenus framework does not support merging in anything but an MDI scenario. I''ve been told it''s possible to extend MainFrameBarManager to add the support, but it would be far easier to modify your application to use MDI than to modify MainFrameBarManager to modify your application. And even if you did, some situations might arise that we would be unable to correct. If you have any questions or require any clarification on this, please feel free to ask.
MMMikaël MorvanJune 17, 2005 12:22 PM
I use this code to merge menus & toolbars
Bar oOriginalBar = BarManagerGetBarFromName(this.MainForm.BarManager, oBar.BarName);
Bar oBarEq = this.MainForm.BarManager.GetMergedEquivalent(oOriginalBar, oOriginalBar);
and this one to clean :
The problem is the MainForm.BarManager.RemoveReferencesToForeignItems() method remove all the child form menus and toolbars (not only the menus and toolbars of the child form that is closing).
When i close a child form, is there a way to clean only its menus & toolbars ?
ADAdministrator Syncfusion Team June 17, 2005 04:18 PM
Unfortunately, this is one of those situations we can''t correct. MainFrameBarManager is designed to only handle merging with one child at a time (due to the nature of the MDI scenario). Because of this, it can''t tell the difference between removing a single child''s BarItems and multiple children''s BarItems. My recommendation would be to remerge with the still open children after closing a child and cleaning the Bar.