- 4 minutes to read
The LayoutControl allows a layout to be modified at design time and runtime (in customization mode). The Customization Form, along with the Context Menu, provides design-time and runtime layout customization capabilities.
This document describes the default Customization Form, which is available at design time and in default runtime customization mode. To learn about the Customization Form capabilities in quick runtime customization mode, see Quick Runtime Customization.
Showing and Hiding Customization Form
At design time, customization mode is always enabled. However, certain customization features (e.g., the ability to hide/restore items) are accessible only when the Customization Form is visible.
The Customization Form can be opened by right-clicking a LayoutControl’s empty space and selecting the Customize Layout command from the context menu. At runtime, opening the Customization Form enables customization mode.
The following animation demonstrates basic customization operations using the Customization Form: hiding and displaying items, accessing the item hierarchy, and changing item properties.
The LayoutControl.ShowCustomizationForm method allows invoking the Customization Form from code.
The Customization Form can be closed by an end-user or hidden programmatically at runtime by using the LayoutControl.HideCustomizationForm method. To respond to closing the form at runtime, handle the LayoutControl.HideCustomization event.
Customization Form Features
The Customization Form allows you and your end-users to:
- Hide specific items and restore hidden items using drag and drop.
- Add Empty Space Items, Labels, Separators and Splitters from the Hidden Items tab to the layout using drag and drop.
- Modify item properties using the built-in Property Grid.
- Access the hierarchical structure of layout items and modify it using drag-and-drop operations directly within the Layout Tree View.
- Save the current layout to an XML file and restore the previously saved layout.
- Undo and redo the customization operations.
The Customization Form can be treated as an instance of the Form class. The LayoutControl.CustomizationForm property provides access to the Customization Form. This property allows you to customize the form as needed (change a caption, size, etc.). The How to: Create custom customization form topic shows how to implement a custom Customization Form.
Customization Form Elements
The image and table below describe the Customization Form elements:
Customization Form Elements
Hidden Items Tab
This pane displays “fixed” items and hidden items, and supports drag-and-drop to/from the Layout Control. To hide an item, drag it from the Layout Control to the Hidden Items list. To add a hidden or fixed item to the layout, drag it to the Layout Control.
The “fixed” items are the Empty Space Item, Label, Separator and Splitter. They are always displayed at the top of the list and are painted in bold.
The “fixed” items are actually not instances, but rather types of items. When any of the fixed items is dragged and dropped onto the Layout Control, an instance of the corresponding item is created. It’s possible to create a custom fixed item and register it with the LayoutControl.RegisterFixedItemType method.
Layout Tree View Tab
The Layout Tree View displaying the hierarchical structure of the Layout Control makes it easy to select layout items, especially those that are hidden by other items or that are small enough to grip them with the mouse. Selecting a tree element highlights the corresponding item in the Layout Control (and vice versa), and displays its properties in the Property Grid. For tree elements, you can invoke the context menu with common customization commands. Pressing the DELETE key deletes the selected layout item. Items can be dragged and dropped within the tree, and between the Layout Control and the tree.
Save and Load Buttons
These buttons allow you and your end-users to save the current layout to an XML file and then restore it.
Undo and Redo Buttons
The Undo button allows your end-user to undo the very last action. Clicking the Redo button reverts to the state existing before the undo operation. These buttons are available only at runtime.
Settings of a selected layout item can be accessed and modified in the embedded Property Grid.
The Layout Control provides options to modify the visibility of the Customization Form elements. These options can be accessed from the LayoutControl.OptionsCustomizationForm property.