# Loading and Saving the Layout of the DockingTab

Get started with Menus and Toolbars for WinForms. Create versatile menus and docking/floating toolbars. See more in documentation here.

## Content



You can save and load the layout of the [C1DockingTab](/componentone/docs/win/online-menus-toolbar/) by using the [SaveLayout](/componentone/docs/win/online-menus-toolbar/) and [RestoreLayout](/componentone/docs/win/online-menus-toolbar/) methods. The syntax for the methods is as follows:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
'Saves the current layout of the tabs on the form to the specified file.
Shared Sub SaveLayout(form As Form, filename As String)
'Restores the previously saved layout of the tabs on the form from the specified file
Sub RestoreLayout(form As Form, filename As String)
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
//Saves the current layout of the tabs on the form to the specified file.
static void SaveLayout(Form form, string filename);
//Restores the previously saved layout of the tabs on the form from the specified file
Static void RestoreLayout(Form form, string filename);
```

DOC-DETAILS-TAG-CLOSE

The following code is an example of how these methods can be applied:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
//Saves the current layout of the tabs on the form to the specified file.
C1DockingTab.SaveLayout(myForm, "myLayoutFile.xml")
'Restores the previously saved layout of the tabs on the form from the specified file
C1DockingTab.RestoreLayout(myForm, "myLayoutFile.xml")
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
//Saves the current layout of the tabs on the form to the specified file.
C1DockingTab.SaveLayout (myForm, "myLayoutFile.xml");
//Restores the previously saved layout of the tabs on the form from the specified file
C1DockingTab.RestoreLayout(myForm, "myLayoutFile.xml");
```

DOC-DETAILS-TAG-CLOSE

## See Also

[Moving Tab Pages at Run Time](/componentone/docs/win/online-menus-toolbar/menusandtoolbarsforw2/dockingtabtasks/movingtabpagesatrunt)