Saves the bars’ layout to the specified system registry path.
public virtual bool SaveLayoutToRegistry( string path )
Public Overridable Function SaveLayoutToRegistry( path As String ) As Boolean
The registry path to save the bars’ layout to.
true if the bars’ layout has been saved to the specified system registry path; otherwise, false.
After the bars’ layout has been saved to the system registry using the SaveLayoutToRegistry method it can then be restored using the BarManager.RestoreLayoutFromRegistry method.
The Bar Manager allows you to automatically store the layout of its bars to the registry when the form is closed and restore the layout when the form is loaded. The BarManager.RegistryPath property specifies where the bars’ settings are stored in this case. Automatic saving/loading of bar layout is enabled if the BarManager.AutoSaveInRegistry property is set to true.
Bar items within the Bar Manager and within the stored layout are identified by unique identifiers specified by the BarItem.Id property. To correctly save the layout, ensure that this property is set to a unique value for each bar item. For items created at design time, the BarItem.Id properties are initialized automatically. For items created in code, you need to manually initialize their BarItem.Id properties.
For more information, see Saving and Restoring a Bars Layout Manually.
The following code demonstrates how to write and read a BarManager’s state to/from the system registry. The full path for the bars layout will be: HKEY_CURRENT_USER\DevExpress\XtraBars\States\MainState.
string regKey = "DevExpress\\XtraBars\\States\\MainState"; barManager1.SaveLayoutToRegistry(regKey); //... barManager1.RestoreLayoutFromRegistry(regKey);