The following example shows how to save the layout of items of a LayoutControl object to a stream, and then restore the layout. The LayoutControlBase.WriteToXML and LayoutControl.ReadFromXML methods are used to do this.
C# |
using System.Xml;
using System.IO;
MemoryStream stream = new MemoryStream();
XmlWriter writer = XmlWriter.Create(stream);
myLayoutControl.WriteToXML(writer);
writer.Close();
stream.Seek(0, SeekOrigin.Begin);
XmlReader reader = XmlReader.Create(stream);
myLayoutControl.ReadFromXML(reader);
reader.Close();
|