Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
935
SaveComponentSettings for DockManager with TabbedMdiManager
posted

Hello,

I have a form with a dock manager and a tabbedMdiManager managing the main window. Panes may be instantiated as DockableMdi panes or Mdi forms only. I am using the IPersistComponentSettings interface methods to save and load my form settings. When saving automatically, the SaveComponentSettings is called in the Dispose() method of the controls. I also offer the user the option to turn off the automatic save, via a toolbar button that sets SaveSettings = false with another toolbar button to SaveLayout where I directly call the SaveComponentSettings method.

These two scenarios result in different user.config files for the UltraTabbedMdiManager. When called directly the user config file maintains the settings for all tabs including those hosting dockable control panes. When called automatically (via Dispose methods) the user.config file only records the mdi tabs without dockable control panes. I suppose this might be a result of the order the dispose methods are called in that if the DockManager disposes first, the tabs would be gone when the TabbedMdiManager disposes and saves its own settings.

I am trying to align these save methods with the load methods. Should I be manually Saving all tabs before disposing any controls OR in the manual methods remove the dockable panes before saving Settings for the MdiManager tabs?

Also, I was wondering if there was a way for the MdiManager to self discover the correct form to put on a tab? I have done this for the DockManager where I add the controls to the MainForm and for the ExplorerBar where I add the controls to an UltrExplorerBarContainer and add the container to the ExplorerBar.Controls(). I have found no way to get the MdiManager to find the correct childForm. Any ideas on this?

Thanks, Wendy

Parents Reply Children
No Data