Skip to main content

DockManager.SaveLayoutToRegistry(String) Method

Saves the layout of dock panels to the specified system registry path.

Namespace: DevExpress.XtraBars.Docking

Assembly: DevExpress.XtraBars.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public virtual bool SaveLayoutToRegistry(
    string path
)

Parameters

Name Type Description
path String

The system registry path to save the dock panels’ layout to.

Returns

Type Description
Boolean

true if the layout of dock panels has been saved to the specified system registry path; otherwise, false.

Remarks

The SaveLayoutToRegistry method saves all the dock panels within the dock manager, their positions, dock styles etc. Appearance settings are not saved by this method.

The path parameter contains the registry key. You are allowed to define whole and partial registry keys. For instance, if you define a partial key, “Software\MyCompany\MyTool" the full path will be as follows: “HKEY_CURRENT_USER\Software\MyCompany\MyTool". If you wish to store a layout in another root key, you should define the entire path, for instance: “HKEY_LOCAL_MACHINE\Software\MyCompany\MyTool".

For more information, see Saving and Restoring the Layout of Dock Panels

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 code can be used to write and read a docking layout to and from the system registry. The full path to the docking layout will be: HKEY_CURRENT_USER\DevExpress\XtraBars\DockStates\MainState.

string regKey = "DevExpress\\XtraBars\\DockStates\\MainState";
dockManager1.SaveLayoutToRegistry(regKey);

// ...

dockManager1.RestoreLayoutFromRegistry(regKey);
See Also