Skip to main content

LayoutControl.SaveLayoutToRegistry(String) Method

Saves the current layout to the specified system registry path.

Namespace: DevExpress.XtraLayout

Assembly: DevExpress.XtraLayout.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public virtual void SaveLayoutToRegistry(
    string path
)

Parameters

Name Type Description
path String

A String value that specifies the system registry path to which to save the layout.

Remarks

The path parameter can be one of the following strings:

  • A full registry path. For example, “HKEY_LOCAL_MACHINE\Software\MyCompany\MyProject".
  • A partial registry path. For example, “Software\MyCompany\MyProject". In this case, the full path is “HKEY_CURRENT_USER\Software\MyCompany\MyProject".

Use the LayoutControl.RestoreLayoutFromRegistry method to restore a saved layout.

See Save and Restore Layout to learn more.

Tip

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

Example

The following sample code can be used to write and read the layout to/from the system registry. The full path for the layout will be: HKEY_CURRENT_USER\DevExpress\Layout Control\Layouts.

string regKey = "DevExpress\\Layout Control\\Layouts";
layoutControl1.SaveLayoutToRegistry(regKey);

// ...

layoutControl1.RestoreLayoutFromRegistry(regKey);
See Also