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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





58772 Mar 28,2007 08:12 AM UTC Apr 19,2007 02:05 PM UTC WinForms 3
Tags: Tools
Dimitar Milov
Asked On March 28, 2007 08:12 AM UTC


How can I modify command bars of the childFrame window in MDITabbed application during run-time. For exapmle i want to remova one item from my childframe toolbar and to add new - how can i do this.

Thank You!

Venugopal M [Syncfusion]
Replied On March 30, 2007 11:02 AM UTC

Hi Dimitar,
We can modify the command bars of child frame window using its object reference from the mainframe. The following code snippet will give detail idea about runtime add/remove barites from the XPToolbar of child Frame.

(All the code snippet should be in mainFrame)

Adding bar Items in XPToolbar of Child Frame.

// get all the child references
Form[] forms=this.MdiChildren;
foreach (Form f in forms)
// get xptoolbar object reference.
XPToolBar xp = f.Controls["xpToolbar1"] as XPToolBar;

// New baritem
BarItems bitems = xp.Bar.Items;
BarItem mybaritem = new BarItem("NewBar");
mybaritem.CategoryIndex = 0;
mybaritem.ID = "NewBar";
mybaritem.PaintStyle =Syncfusion.Windows.Forms.Tools.XPMenus.PaintStyle.TextOnly;
mybaritem.Text = "NewBar";

// adding new bar item into xptoolbar.

Removing BarItem from the XPToolbar of ChildFrame

// get all the child references
Form[] forms=this.MdiChildren;
foreach (Form f in forms)
// get xptoolbar object reference.
XPToolBar xp = f.Controls["xpToolbar1"] as XPToolBar;
BarItems bitems = xp.Bar.Items;

//Removing baritem using its id.

This code will add and remove the baritem in XPToolbar from all the childFrame. If you need particular childframe operation just you can check the childframe reference inside of loop then you could allow add/remove.

Thank you for interest in Syncfusion products.

Please Let me know if you have any queries.

Thanks ,
Venugopal M.

Replied On April 2, 2007 11:22 AM UTC

Hi, I'm using BarManagers and automerging. In this case I should change the ChildFrameBarManager items and should remerge ChildFrameBarManager with the MainFrameBarManager. I'm doing this by calling UnregisterMdiChildTypes and then against calling RegisterMdiChildTypes.

RegisterMdiChildTypes creates dummy instance of my type which contains all changes in the menus and toolbars, but do not merges by some reason.....
I suppose that it uses childFrameBarManager of my current childframe instance.

If there is some way to remerge all toolbars and menus for all childframes of the same type I'll solve my problem.

Thank You!

Golda Rebecal [Syncfusion]
Replied On April 19, 2007 02:05 PM UTC

Hi Dimitar,

Sorry for the delay in responding.

I have attached a sample that shows how to remove a baritem from the child form and add a new bar item dynamically.

Please have a look at the attached sample and let me know if this meets your requirement.

Thanks for your interest in Syncfusion products.


Best regards,


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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