LayoutControl.SaveLayoutToRegistry(String) Method

Saves the current layout to the specified system registry path.

Namespace: DevExpress.XtraLayout

Assembly: DevExpress.XtraLayout.v20.1.dll

Declaration

public virtual void SaveLayoutToRegistry(
    string path
)
Public Overridable Sub SaveLayoutToRegistry(
    path As String
)

Parameters

Name Type Description
path String

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

Remarks

You can define whole and partial registry keys as the parameter. For instance, specifying "Software\MyCompany\MyProject" as a partial key will result in settings being saved to the "HKEY_CURRENT_USER\Software\MyCompany\MyProject" path. You can also specify the entire path if you need to store the layout to another root key. An example is the "HKEY_LOCAL_MACHINE\Software\MyCompany\MyProject" registry path.

Once saved a layout can be loaded using the LayoutControl.RestoreLayoutFromRegistry method.

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.

Examples

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

Implements

DevExpress.XtraLayout.ILayoutControl.SaveLayoutToRegistry(String)
DevExpress.Utils.Serializing.ISupportXtraSerializer.SaveLayoutToRegistry(String)
See Also