Skip to main content

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:

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.

Visibility

An item’s Visible property.

Position

An item’s Index, VisibleIndex, AlignHorz, AlignVert, AlignmentConstraint, and Offsets properties.

A parent group’s LayoutDirection and UseIndent properties.

Appearance

An item’s LayoutLookAndFeel and CaptionOptions properties property.

A parent group’s LayoutLookAndFeelException property.

The layout control’s LayoutLookAndFeel property.

For an item’s linked control, use the item’s ControlOptions.AutoControlAreaAlignment, ControlOptions.AutoColor, ControlOptions.Opaque, and ControlOptions.ShowBorder properties.

Contents

An item’s CaptionOptions.VisibleElements and Control properties.

Behavior

An item’s CaptionOptions.Hint, SizeOptions.SizableHorz, SizeOptions.SizableVert, AllowRemove, and Enabled properties.

A parent group’s Locked property.

The layout control’s OptionsItem.AllowGroupWrapItems, OptionsItem.AllowQuickCustomize, OptionsItem.SizableHorz, and OptionsItem.SizableVert properties.

Size

An item’s SizeOptions.Height, SizeOptions.Width, SizeOptions.MaxHeight, and SizeOptions.MaxWidth properties.

For an item’s linked control, use the item’s ControlOptions.AlignHorz, ControlOptions.AlignVert, ControlOptions.MinHeight, and ControlOptions.MinWidth properties.

Context Menu

Refer to the Runtime Customization Context Menus topic.

HitTest Information

For standard layout items, the layout control’s GetHitTest function returns a TdxLayoutItemHitTest object.

See Also