Back to Devexpress

DockManager.RestoreLayoutFromRegistry(String) Method

windowsforms-devexpress-dot-xtrabars-dot-docking-dot-dockmanager-dot-restorelayoutfromregistry-x28-system-dot-string-x29.md

latest3.3 KB
Original Source

DockManager.RestoreLayoutFromRegistry(String) Method

SECURITY-RELATED CONSIDERATIONS

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

Restores the layout of dock panels from the specified system registry path.

Namespace : DevExpress.XtraBars.Docking

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public virtual void RestoreLayoutFromRegistry(
    string path
)
vb
Public Overridable Sub RestoreLayoutFromRegistry(
    path As String
)

Parameters

NameTypeDescription
pathString

A string value that 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 DockManager.ForceInitialize method prior to the layout restoration. See this method to learn more.

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

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.

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

// ...

dockManager1.RestoreLayoutFromRegistry(regKey);
vb
Dim regKey As String = "DevExpress\XtraBars\DockStates\MainState"
DockManager1.SaveLayoutToRegistry(regKey)

'...

DockManager1.RestoreLayoutFromRegistry(regKey)

See Also

SaveLayoutToRegistry(String)

RestoreLayoutFromStream(Stream)

RestoreLayoutFromXml(String)

RestoreLayoutError

Save and Restore Layouts of DevExpress controls

DockManager Class

DockManager Members

DevExpress.XtraBars.Docking Namespace