Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Collapse]Form Layout Managers
    Side Panel
   [Collapse]Layout Manager
    [Expand]Product Information
    [Expand]Getting Started
    [Expand]Layout Control
    [Expand]Data Layout Control
    [Expand]Layout Item
    [Expand]Layout Groups
    [Expand]Tabbed Group
    [Expand]Other Layout Elements
    [Expand]Customization Capabilities
    [Collapse]Size and Alignment
      Size Constraints
      Default Size Constraints
      Custom Size Constraints
      Layout Item's Size Constraints vs. Client Area's Size Constraints
      Locking the Size of Layout Items (animation)
      Aligning Controls Within Layout Items
      Layout Support For Third Party Controls
     Flow Layout
     Table Layout
     Focus Management
    [Expand]Appearance and Look and Feel
    [Expand]Miscellaneous
    [Expand]Examples
    [Expand]Member Tables
   [Expand]Tabbed MDI Manager
    Tab Control
   [Expand]Wizard Control
    Workspace Manager
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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

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:

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.

How would you rate this topic?​​​​​​​