Skip to main content
Bar

BarManager.RestoreLayoutFromRegistry(String) Method

SECURITY NOTE

Deserializing layout settings from untrusted resources may create security issues. Review the following help topic for additional information: Safe Deserialization.

Restores the bars’ layout from the specified system registry path.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public virtual void RestoreLayoutFromRegistry(
    string path
)

Parameters

Name Type Description
path String

A string value which specifies the system registry path. If the specified path doesn’t exist, this method does nothing.

Remarks

Note

When restoring a layout during a form load (for instance, in your Form.Load event handler), you may need to call the BarManager.ForceInitialize method prior to the layout restoration. See this method to learn more.

For more information, see Saving and Restoring a Bars Layout Manually.

Example

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);
See Also