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.

MainFrameBarManager Save/Load with runtime created bar and item

Thread ID:

Created:

Updated:

Platform:

Replies:

25404 Feb 25,2005 11:16 AM Mar 2,2005 01:58 PM Windows Forms 13
loading
Tags: Tools
Martin Bonneville
Asked On February 25, 2005 11:16 AM

Hi, All items and toolbars are created at runtime. The save and load do not work. But if I created manually some toolbars at runtime... when I restart the application, the toolbar reappear but no item in it. What I need to do ? Best regards, Martin

Administrator [Syncfusion]
Replied On February 25, 2005 12:18 PM

Hi Martin, Are you able to provide a sample that demonstrates this problem? Regards, Gregory Austin Syncfusion Inc.

Martin Bonneville
Replied On February 25, 2005 01:26 PM

Hi Gregory, I can''t upload file with the attach button. The popup appear but never end loading ! :-( Do you have an E-mail where I can send you my test application ? Regards, Martin

Administrator [Syncfusion]
Replied On February 25, 2005 01:47 PM

Hi Martin, You can send me the attachment directly at gregorya@syncfusion.com Regards, Gregory Austin Syncfusion Inc.

Martin Bonneville
Replied On February 25, 2005 01:59 PM

Hi Gregory, Mail sent... Regards, Martin

Administrator [Syncfusion]
Replied On February 25, 2005 03:17 PM

Hi Martin, To do what I think you''re trying to do, you''ll want to manually Load and Save your Bar state with MainFrameManager.LoadBarState and MainFrameBarManager.SaveBarState. Currently the loading of your bar state is failing because it occurs before you create the BarItems, so it can''t add them to the Bar. Regards, Gregory Austin Syncfusion Inc.

Martin Bonneville
Replied On February 25, 2005 03:59 PM

Hi Gregory, Can I use the automatic save and load manualy? If yes, can you give me an example of the load sequence? Thank Best regards, Martin

Martin Bonneville
Replied On February 28, 2005 01:42 PM

Hi Gregory, Do you have an example for me ? Regards, Martin

Administrator [Syncfusion]
Replied On March 1, 2005 12:45 PM

Hi Martin, Please refer to the test sample attached. It shows you how you could load/save menu state information manually using the MainFrameBarManager''s LoadBarState/SaveBarState methods. 1. Run the sample 2. Press the "Add Menus" button 3. Float the toolbar 4. Press "Save" button to save the menu state information 5. Close the application 6. Reload the application 7. Press the "Load" button to restore the menu state information You will see that the saved menu state information is correctly restored. Let me know if you need further assistance. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Administrator [Syncfusion]
Replied On March 1, 2005 12:48 PM

Hi Martin, After step (6) above, press the "Add Menus" button again to recreate the menus before movingto step (7). Note that the LoadBarState/SaveBarState methods can only restore/save state information and cannot create/delete the menu bars or items. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Martin Bonneville
Replied On March 1, 2005 01:24 PM

Hi Guru, Thank for you sample. I try it in my application, all work fine for saving state of "default" bars and items. If I add items, menus (or check the Large icons checkbox) with customization dialog, all the customization is lost. I need to do something special to save the user customization ? Best regards, Martin

Administrator [Syncfusion]
Replied On March 2, 2005 10:40 AM

Hi Martin, I''ve done some more research into this and XPMenus only supports loading customization data during the initialization of the MainFrameBarManager. You should still be able to create BarItems at Runtime, but you''ll have to create them in the Constructor. I apologize for the confusion. Please let me know if you have any further questions. Regards, Gregory Austin Syncfusion Inc.

Martin Bonneville
Replied On March 2, 2005 01:24 PM

Hi Gregory, The loading work fine with "default" bars and items. (bars and items always created by the application) Only the custom bars (created by user at runtome) are not saved or loaded. Then what you say is: Custom bars can be loaded only in form constructor (just after InitializeComponents) ? Best regards, Martin

Administrator [Syncfusion]
Replied On March 2, 2005 01:58 PM

Hi Martin, I believe that you would need to remove the MainFrameBarManager initialization code from InitializeComponent and place that in the same place where you add your BarItems. The best place for this would be the constructor, but it might work in in the Load event handler. Regards, Gregory Austin 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.

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.

;