windowsforms-17514-controls-and-libraries-form-layout-managers-layout-and-data-layout-controls-design-time-and-runtime-customization-design-time-layout-templates.md
At design time, the Layout Control’s Templates feature allows you to create common and frequently-used layouts with a few mouse clicks. Predefined templates shipped with the Layout Control provide common layout solutions out of the box. In addition, you can easily create a custom template from controls in your existing project and reuse this template in other projects.
Layout templates are available in the Templates tab in the Customization Form at design time.
A template can be added to the LayoutControl using the drag-and-drop functionality. After dropping the template, all its elements are added to the LayoutControl. You can then rearrange and rename the added elements and change their settings in the Properties grid.
The LayoutControl ships with a set of predefined templates. Several examples are shown below.
| Template Name | Layout |
|---|---|
| 2x2 TextEdit | |
| Sign In Form | |
| Buttons Yes, No, Cancel | |
| Tabbed Empty Group |
You can combine frequently used controls into a custom template and reuse it in other projects.
To create a new layout template, do the following:
At design time, select one or multiple layout items and choose the Create Template command from the context menu.
In the invoked Create Template dialog, type a new template name and click the Save button.
After that, the template will be available in the Customization Form’s Templates tab.
All custom templates are stored in the %Public%\Documents\DevExpress\XtraLayout\UserTemplates folder as XML files. If you wish to remove a specific custom template from the LayoutControl’s Customization Form, delete the corresponding XML file.
Take note of the following while saving and restoring templates.
See Also