Bar

BarManager.SaveLayoutToRegistry() Method

Saves the bars’ layout to the system registry.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v21.2.dll

Declaration

public bool SaveLayoutToRegistry()

Returns

Type Description
Boolean

true if the bars’ layout has been saved to the system registry; otherwise, false.

Remarks

The SaveLayoutToRegistry method saves the bars’ layout to the system registry path which is specified by the BarManager.RegistryPath property. After the bars’ layout has been saved using this 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. In this case, the BarManager.RegistryPath property specifies where the bars’ settings are stored. Automatic saving/loading of a 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.

Tip

You can utilize the Persistence Behavior or Workspace Manager component to save and restore layouts for all supported DevExpress controls at once.

See Also