Back to Devexpress

LayoutControl.RestoreLayoutFromRegistry(String) Method

windowsforms-devexpress-dot-xtralayout-dot-layoutcontrol-dot-restorelayoutfromregistry-x28-system-dot-string-x29.md

latest3.0 KB
Original Source

LayoutControl.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 that is stored at the specified system registry path.

Namespace : DevExpress.XtraLayout

Assembly : DevExpress.XtraLayout.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

The LayoutControl.SaveLayoutToRegistry method saves the LayoutControl’s layout to the system registry. You can then restore this layout using the RestoreLayoutFromRegistry method.

See Save and Restore Layout to learn more.

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.

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

// ...

layoutControl1.RestoreLayoutFromRegistry(regKey);
vb
Dim regKey As String = "DevExpress\Layout Control\Layouts"
LayoutControl1.SaveLayoutToRegistry(regKey)

' ...

LayoutControl1.RestoreLayoutFromRegistry(regKey)

See Also

LayoutControl.RestoreLayoutFromStream

OptionsSerialization

Save and Restore Layouts of DevExpress controls

LayoutControl Class

LayoutControl Members

DevExpress.XtraLayout Namespace