$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Dock Control for C# WinForms
Docking User Controls and Forms of Dock Control in C# Windows Forms C# projects
Home > WinForms UI Controls > User Manual > Load and Save Layout in C#

Save and Load Layouts in C# for Dock Control

When users using the Dock WinForms control, they can use the provided methods to save and load layouts, which is used to keep the records of the size and arrangement of dock windows included in the Kettic WinForms dock control. The save and load layouts are able to saves all managed tool widnow and document window, regardless of state of a window that is hidden, floated, or saved.

C# code to Save a Layout

The C# code below illustrate the way of calling the method, Dock.SavetoXML(), to save a layout.

this.dock.SavetoXml("d:\\layout.xml");

C# code to Load a Layout

The C# code below shows the way of calling the method, Dock.LoadfromXML(), to load a layout.

this.dock.LoadfromXml("d:\\layout.xml");

C# Tutorial to Save and Load Content

The Kettic Dock Control provides the support of saving and loading the layouts of dock windows, but the content of the dock windows. The following is a C# guide to show the process of save and load the content of the dock windows.
  1. First, we need to put the content of the task into the user controls which is included in dock window to make it easy to save and load the content.
  2. Second, we need to set the path to the xml file, in which the layout will be saved.
  3. Third, we can check whether the xml file exists or not at the Load event of our form. Then we can load the layout when the xml file exists.
  4. It is the time to arrange the dock window in a way of user friendly
  5. Close the form which contains the dock control. Save the layout to the place with the Form Closing event handler
  6. Open the form again and the content and layout will be loaded with the methods such as, LoadfromXml, which will create and arrange host window, and LoadContent, which loads the content in the created host window.
  7. Then, we can get the result that save and load the layout and content
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls