Layout Item
- 3 minutes to read
The base elements of the ExpressLayout Control are items and groups. Items are divided into two categories: standard and auxiliary. This topic covers the capabilities of standard items. To learn about auxiliary items, refer to this topic.
A standard layout item is considered a container for any TControl descendant. A control can be placed into the item in one of the following ways:
Drop the desired control from the Component Palette onto a layout control on a form. A layout item will be automatically created for this control and linked to it. Use the item’s ControlOptions property to specify the linked control’s appearance within the layout control.
Customization Form. Double-click the layout control to open the Customization Form. In the Customization Form‘s Available Items pane, click the Add Item… button to create a new item. Use the item’s Control property to link a control located on the form to the item.
To programmatically create items, call one of the following methods:
A group’s CreateItem or CreateItemForControl method;
The layout control’s CreateItem or CreateItemForControl method.
To learn more, refer to the How to Create Items and Groups help topic.
Newly created items are first placed in the Available Items pane, which means that they are not displayed in the layout control. To make them visible in the View, drag the item from the pane to the target location in the layout control.
Layout items that are visible in the layout control are displayed within the Layout Tree View pane.
An item may have a caption, and a border.
An item’s control container draws the control’s borders. The border style depends upon the item style. You can make borders invisible.
Use the CaptionOptions.Visible property of an item to display its caption. An item caption may be painted on the left/right/top/bottom. If you specify a fixed caption width, then the caption height will be calculated automatically to let end-users span text across multiple lines. Use the CaptionOptions property to specify the item caption layout and its alignment based upon the control embedded within the item.
Layout, caption, and border types depend on the container’s style. Refer to the corresponding topic to learn about available styles.
Item width/height may be fixed or calculated automatically within a group, based on the size of the group and other items. To improve the appearance, you can adjust horizontal and vertical offsets inside groups and items.
The table below lists the main properties that relate to layout items.