Saves the control’s layout to the specified system registry path.
A string value specifying the system registry path to which the layout is saved.
true if the layout was successfully saved; otherwise false.
The control’s layout is saved to 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 a different 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.
navBarControl1.SaveToRegistry( "HKEY_LOCAL_MACHINE\\SOFTWARE\\DevExpress Inc\\NavBarLayout"); navBarControl2.RestoreFromRegistry( "HKEY_LOCAL_MACHINE\\SOFTWARE\\DevExpress Inc\\NavBarLayout");