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.

XPMenus Bar Order

Thread ID:

Created:

Updated:

Platform:

Replies:

3064 Feb 27,2003 04:28 PM Mar 4,2005 05:35 AM Windows Forms 4
loading
Tags: Tools
Tom Le Blanc
Asked On February 27, 2003 04:28 PM

I hope I haven’t overlooked an FAQ or forum entry where this was addressed. We’ve created a form that is housed in an MDI parent per your instructions in the XPMenu FAQ 10.5 Why is an additional instance of my child Form created by the menus framework? We construct the menus at runtime and we have a blank constructor which calls Me.InitializeBarItems() and Me.InitializeBars(New XPMenus.ChildFrameBarManager(Me.components, Me)) This is in addition to the main constructor’s calls to both of those subroutines. Me.InitializeBarItems() Me.InitializeBars(New XPMenus.ChildFrameBarManager(Me)) Or Me.InitializeBars(New XPMenus.MainFrameBarManager(Me)) if not MDI This has lead to the weird behavior observed when in the MDI parent-child mode: When the first instance of the form is created the order of the bars in the XPMenu is reversed from the desired order. When a second or third instance of the form is created the bars in the menu appear in the proper order. When the form is called on its own (non-MDI) the order of the bars is correct. InitializeBars() adds the bars to the XPMenu like so: mBarManager.Bars.Add(mSessionBar) mBarManager.Bars.Add(mViewBar) I've even tried mBarManager.Bars.AddRange(New XPMenus.Bar() {mSessionBar, mViewBar}) but that still didn’t solve the flip-flop of the bars’ order. I have just downloaded and installed 1.5.2.0 – there was no change to this situation. Any thoughts? Thanks, Tom

Ramesh Praveen [Syncfusion]
Replied On February 28, 2003 08:14 AM

Tom, Try enclosing your barmanager initialization within BeingInit and EndInit calls (in the barmanager). That might make a difference. If it still didn't work, please attach that InitiazeBars method code here. Regards, Praveen Ramesh

Tom Le Blanc
Replied On February 28, 2003 08:28 AM

I tried using the BeginInit and EndInit in here but still no dice. Private Sub InitializeBars(ByVal barManager As XPMenus.BarManager) 'BarManager mBarManager = barManager mBarManager.Categories.Add("Session") mBarManager.Categories.Add("Actions") mBarManager.Categories.Add("Scenarios") mBarManager.Categories.Add("Years") mBarManager.Categories.Add("Rows") mBarManager.CurrentBaseFormType = "System.Windows.Forms.Form" mBarManager.EnableCustomizing = False mBarManager.Form = Me mBarManager.ImageList = Me.IconList mBarManager.Items.AddRange(New XPMenus.BarItem() {mSaveBarItem, mCalculateBarItem, mResultsBarItem, mAddScenarioBarItem, mPropertiesBarItem, mViewBarList}) mBarManager.LargeImageList = Me.IconList mBarManager.UsePartialMenus = False 'SessionBar mSessionBar = New XPMenus.Bar(mBarManager, "Session") mSessionBar.BarStyle = XPMenus.BarStyle.Visible Or XPMenus.BarStyle.DrawDragBorder mSessionBar.Items.AddRange(New XPMenus.BarItem() {mSaveBarItem, mCalculateBarItem, mResultsBarItem}) mSessionBar.BeginGroupAt(mCalculateBarItem) 'ViewBar mViewBar = New XPMenus.Bar(mBarManager, "View") mViewBar.BarStyle = XPMenus.BarStyle.Visible Or XPMenus.BarStyle.DrawDragBorder mViewBar.Items.AddRange(New XPMenus.BarItem() {mViewBarList, mAddScenarioBarItem, mPropertiesBarItem}) 'Add both bars to the bar manager. mBarManager.Bars.Add(mSessionBar) mBarManager.Bars.Add(mViewBar) End Sub Thanks, Tom

Ramesh Praveen [Syncfusion]
Replied On March 3, 2003 03:05 PM

Tom, I am out of ideas now. Could you please prepare a small sample and attach it here? Note that the toolbar positions will also be based on the persisted state of the previous instantiation. You could set AutoLoadToolBarPositions to false and check if the behavior is any different. Regards, Praveen Ramesh

Andy Tarpey
Replied On March 4, 2005 05:35 AM

I had a similar problem with toolbar ordering when I was dynamically creating them at run-time. In the end I solved it by setting MainFrameBarManager.BarPositionInfo to null. Hope this helps, Andy.

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.

;