ComponentOne TileControl for WinForms
TileControl for WinForms Task-Based Help / Saving and Loading TileControl as an XML File / Saving TileControl as an XML File
In This Topic
    Saving TileControl as an XML File
    In This Topic

    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.

      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:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    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
    

    To write code in C#

    C#
    Copy Code
    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);
            }
        }
    }