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:
- Right-click the C1TileControl and select Save as XML File item from the context menu.
The Save As Xml File dialog box appears.
- Browse to the location you wish to save the .xml file.
- 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);
}
}
}
|