This task shows how to save the C1TileControl as an XML File at design time and in code.
To save the C1TileControl as an XML file at design time, complete the following:
The Save As Xml File dialog box appears.
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); } } } |