# Saving TileControl as an XML File

## Content



This task shows how to save the C1TileControl as an XML File at design time and in code.

### Save C1TileControl as an XML file at design time

To save the C1TileControl as an XML file at design time, complete the following:

1.  Right-click the C1TileControl and select **Save as XML File** item from the context menu.<br />![](https://cdn.mescius.io/document-site-files/images/9533f9b7-015c-42ba-9666-c32678ceddaf/imagesext/image9_10.png)
    
    The **Save As Xml File** dialog box appears.
    
2.  Browse to the location you wish to save the .xml file.
3.  Click **Save** in the **Save As Xml File** dialog box.

### Save C1TileControl from XML file in code

To save the C1TileControl as an XML file in code, complete the following:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
Private Sub menuitemSaveXml_Click(sender As Object, e As EventArgs)
       Using dlg As New SaveFileDialog()
              dlg.DefaultExt = ".xml"
              dlg.FileName = "tilecontrol
              dlg.Filter = "XML files|*.xml|All files|*.*"
              dlg.Title = "Save As Xml File"
              If dlg.ShowDialog() = DialogResult.OK Then
                     TileControl.SaveXml(dlg.FileName)
              End If
       End Using
End Sub
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
private void menuitemSaveXml_Click(object sender, EventArgs e)
{
    using (SaveFileDialog dlg = new SaveFileDialog())
    {
        dlg.DefaultExt = ".xml";
        dlg.FileName = "tilecontrol";
        dlg.Filter = "XML files|*.xml|All files|*.*";
        dlg.Title = "Save As Xml File";
        if (dlg.ShowDialog() == DialogResult.OK)
        {
            TileControl.SaveXml(dlg.FileName);
        }
    }
}
```

DOC-DETAILS-TAG-CLOSE