windowsforms-devexpress-dot-xtralayout-dot-layoutcontrol-dot-savelayouttostream-x28-system-dot-io-dot-stream-x29.md
Saves the current layout to the specified stream.
Namespace : DevExpress.XtraLayout
Assembly : DevExpress.XtraLayout.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public virtual void SaveLayoutToStream(
Stream stream
)
Public Overridable Sub SaveLayoutToStream(
stream As Stream
)
| Name | Type | Description |
|---|---|---|
| stream | Stream |
A Stream descendant to which the current layout is written.
|
Use the SaveLayoutToStream method to write the current layout to a stream. The layout can then be read using the LayoutControl.RestoreLayoutFromStream method.
See Save and Restore Layout to learn more.
Tip
You can utilize the Persistence Behavior or Workspace Manager component to save and restore layouts for all supported DevExpress controls at once.
The following sample code saves the current layout to a memory stream and then restores it.
System.IO.Stream stream;
stream = new System.IO.MemoryStream();
layoutControl1.SaveLayoutToStream(stream);
stream.Seek(0, System.IO.SeekOrigin.Begin);
// ...
layoutControl1.RestoreLayoutFromStream(stream);
stream.Seek(0, System.IO.SeekOrigin.Begin);
Dim stream As System.IO.Stream
stream = New System.IO.MemoryStream()
LayoutControl1.SaveLayoutToStream(stream)
stream.Seek(0, System.IO.SeekOrigin.Begin)
' ...
LayoutControl1.RestoreLayoutFromStream(stream)
stream.Seek(0, System.IO.SeekOrigin.Begin)
See Also