FlexLayout

Container for automatic positioning of control elements.

Symbol

Menu ribbon

Start > Controls > Container > Layout > FlexLayout

The "FlexLayout" control element is a container for automatically positioning the elements it contains. The FlexLayout is placed on a higher-level container, e.g. on a page, in the Designer.

Functionalities

The FlexLayout supports the following functionality:

You can configure these functionalities via the properties in the Properties window when you select the control in the Designer or in the document outline.

Style

There are no system styles available for the layout container. You can create your own styles for the control element. These styles are available for selection in the "Style" property after creation.

Structure

If a FlexLayout is placed on a page, it initially has no other elements. Control elements that are placed on the FlexLayout are added to the FlexLayout as sub-elements.

The FlexLayout can accommodate any control elements.

Automatic positioning

The FlexLayout automatically arranges the elements placed on it in rows or columns. If the size of the FlexLayout is changed, the control elements can jump to the next row or column. The elements can also be aligned within the rows or columns.

If a control element is placed on the FlexLayout, the "FlexGrow" and "FlexShrink" properties are available in the "Layout " category, which allow the control element to shrink or expand as required.

The following properties are available in FlexLayout for the automatic positioning of contained elements:

Orientation

Determines whether the elements contained are arranged in rows (Horizontal) or columns (Vertical).

Orientation=Horizontal and Orientation=Vertical

Wrap

Specifies that excess elements automatically jump to the next row or column if they require more space than the width or height of the container. If Wrap = true, then the respective row is as high as the highest element in the row and the respective column is as wide as the widest element in the column.

Wrap = False and Wrap = True

AlignItems

Defines the alignment of the elements perpendicular to the setting of the "Orientation" property. If there are several rows/columns with the elements in the FlexLayout (Wrap = true), then "AlignItems" defines the alignment of the elements within each row/column perpendicular to the "Orientation" setting.

AlignContent

If there is more than one row/column with the elements in the container, this property defines the position of the rows/columns. The property acts perpendicular to the setting of the "Orientation" property.

JustifyContent

Defines the orientation of the elements within the row(s)/column(s). The property works in the direction of the Orientation property setting.

Gap

You can set a vertical gap (Row Gap) or a horizontal gap (Column Gap) between all child controls of the FlexLayout container.

​​Several columns or rows can only appear if there are more elements than fit into a column (if Orientation=Vertical) or row (if Orientation=Horizontal) and if the Wrap property was enabled.

Orientation=Vertical, Wrap=true, Row Gap, Column Gap

Orientation=Horizontal, Wrap=true, Row Gap, Column Gap

The visible space between the child elements in a FlexLayout can differ from what is set in the Gap property since the AlignItems, JustifyContent, AlignContent as well as Margin and Padding properties are included in the calculation of the visible space.

Example: A FlexLayout positions its child elements in columns (Orientation=Vertical). All four margins of each child element are set to 8px. A horizontal gap of 12px is set in the Row Gap property for the FlexLayout. The spacing between child element 1 and child element 2, for example, is calculated based on Margin Bottom of child element 1, Margin Top of child element 2 and Column Gap, resulting in 8px+8px+12px=28px.

Orientation=Vertical, Wrap=true, Row Gap, Column Gap, Margin

Addition of gap and margins

Related topics: