Back to Devexpress

How to: Write and read a docking layout to and from memory

windowsforms-5433-controls-and-libraries-docking-library-examples-how-to-write-and-read-a-docking-layout-to-and-from-memory.md

latest931 B
Original Source

How to: Write and read a docking layout to and from memory

  • Nov 13, 2018

The following code demonstrates how to write and read the docking layout to and from memory.

csharp
System.IO.Stream stream = new System.IO.MemoryStream();
dockManager1.SaveLayoutToStream(stream);
// Set the stream pointer to the beginning.
stream.Seek(0, System.IO.SeekOrigin.Begin);

// ...

dockManager1.RestoreLayoutFromStream(stream);
// Set the stream pointer to the beginning.
stream.Seek(0, System.IO.SeekOrigin.Begin);
vb
Dim stream As System.IO.Stream
stream = New System.IO.MemoryStream()
DockManager1.SaveToStream(stream)
' Set the stream pointer to the beginning.
stream.Seek(0, System.IO.SeekOrigin.Begin)

' ...

DockManager1.RestoreFromStream(stream)
' Set the stream pointer to the beginning.
stream.Seek(0, System.IO.SeekOrigin.Begin)