windowsforms-devexpress-dot-xtralayout-dot-layoutcontrol-dot-savelayouttoregistry-x28-system-dot-string-x29.md
Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.
Saves the current layout to the specified system registry path.
Namespace : DevExpress.XtraLayout
Assembly : DevExpress.XtraLayout.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public virtual void SaveLayoutToRegistry(
string path
)
Public Overridable Sub SaveLayoutToRegistry(
path As String
)
| Name | Type | Description |
|---|---|---|
| path | String |
A String value that specifies the system registry path to which to save the layout.
|
The path parameter can be one of the following strings:
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.
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);
Dim regKey As String = "DevExpress\Layout Control\Layouts"
LayoutControl1.SaveLayoutToRegistry(regKey)
' ...
LayoutControl1.RestoreLayoutFromRegistry(regKey)
See Also