A newer version of this page is available. Switch to the current version.

NavBarControl.RestoreFromRegistry(String) Method

Restores the control layout stored at a specified system registry path.

Namespace: DevExpress.XtraNavBar

Assembly: DevExpress.XtraNavBar.v19.1.dll


public virtual void RestoreFromRegistry(
    string path
Public Overridable Sub RestoreFromRegistry(
    path As String


Name Type Description
path String

A string value specifying the system registry path.


Use the RestoreFromRegistry method to restore the NavBarControl's layout written to the system registry by the NavBarControl.SaveToRegistry method.

The control's layout is restored from the path specified by the path parameter. 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".


To allow a layout to be correctly saved and restored, ensure that all nav bar groups and items created at runtime have their names (the Name property) specified.


The following sample code demonstrates a way in which to save control layout to the registry and then restore it. The NavBarControl.SaveToRegistry and NavBarControl.RestoreFromRegistry methods are used for this purpose.

The image below displays two NavBarControl controls before and after code execution. Note that the second control is initially empty (it doesn't contain any groups and items). Layout information of the first control is saved to the registry. The second control restores it. Note that only the layout of groups and links is saved.


  "HKEY_LOCAL_MACHINE\\SOFTWARE\\DevExpress Inc\\NavBarLayout");
  "HKEY_LOCAL_MACHINE\\SOFTWARE\\DevExpress Inc\\NavBarLayout");
See Also