Skip to main content
All docs
V19.1

Layout Item's Size Constraints vs. Client Area's Size Constraints

  • 3 minutes to read

The Layout Control allows size constraints to be imposed either on a layout item or the item’s client area that displays a control. Additionally it’s possible to set size constraints to the control itself via its MaximumSize and MinimumSize properties. See Custom Size Constraints to learn more. The current topic describes how a layout item’s size constraints and its client area’s size constraints are linked.

Size constraints can be set via the following properties:

A layout item’s size constraints and client area’s size constraints are interdependent. When you change the item’s size constraints, the client area’s size constraints are automatically recalculated and vice versa. This is explained below.

A layout item consists of the following regions: inner and outer border indents, text region, control’s indent and client area which displays the item’s control. The image below shows which elements constitute the layout item’s width:

ItemSize3

When a layout item is resized, the indents and text region’s size remain constant. In this case, the layout item’s client area is resized. The size constraints imposed on the layout item and its client area depend on each other. When the MinSize.Width property is changed, the ControlMinSize.Width property, which specifies the client area’s width, is recalculated as follows:

ControlMinSize.Width = MinSize.Width - (Left and right border inner and outer indents + Text region's width + Control's indent)

When the ControlMinSize.Width is set to a new value the MinSize.Width property is recalculated as follows:

MinSize.Width = ControlMinSize.Width + (Left and right border inner and outer indents + Text region's width + Control's indent)

The same considerations are applied to the MaxSize and ControlMaxSize properties. The Height attribute of the MinSize, ControlMinSize, MinSize and ControlMaxSize properties is calculated accordingly.

The text region can be displayed above or below the layout item’s client area or can be hidden completely. In this case, the Layout Control uses other formulas to calculate a layout item’s size constraints based on the client area’s size constraints and vice versa.