[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [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]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Collapse]Form Layout Managers
    Side Panel
   [Collapse]Layout and Data Layout Controls
    [Expand]Product Information
    [Expand]Getting Started
    [Expand]Layout Control
    [Expand]Data Layout Control
    [Expand]Layout Items
    [Expand]Layout Groups
    [Expand]Tabbed Groups
    [Expand]Other Layout Elements
    [Expand]Design-Time and Runtime Customization
    [Collapse]Size and Alignment
      Size Constraints
      Default Size Constraints
      Custom 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]Member Tables
   [Expand]Tabbed MDI Manager
    Tab Control
   [Expand]Wizard Control
    Workspace Manager
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst 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]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Default Size Constraints

If the LayoutControlItem.SizeConstraintsType property is set to Default, layout items and their controls are resized according to specific default size constraints. These constraints are dependant on the type of control the layout item displays.

Expanded Default Size Constraints

You can customize default size constraints using one of two approaches:

  1. Set the Control.MinimumSize and Control.MaximumSize properties of embedded controls;

  2. Implement the IXtraResizableControl interface for an embedded control.

    The interface members provide the necessary information on how the control will be represented within the Layout Control. Here is the interface's declaration:

Most DevExpress WinForms controls implement the IXtraResizableControl interface to return specific default size constraints. You can also implement this interface for your own controls if required.

Take note of how the default maximum size constraint is calculated. If a control implements the IXtraResizableControl interface and you also set the Control.MaximumSize property, the resulting default maximum size constraint will be calculated according to the OptionsView.ControlDefaultMaxSizeCalcMode property. By default, this property is customized to suit most scenarios (e.g., you have the ability to restrict the maximum width, without affecting the maximum height).

Expanded Default Size Constraints for Standard WinForms Controls

One additional, though less common way to set default size constraints for controls is using the LayoutControl's ConstraintsManager object. The ConstraintsManager contains a table of constraints for a number of standard WinForms controls. You can also add size constraints for your own control type if needed.

Currently, the size constraints are registered for the following standard controls: Button, CheckBox, CheckedListBox, ComboBox, DateTimePicker, DomainUpDown, Label, LinkLabel, ListBox, ListView, MonthCalendar, NumericUpDown, ProgressBar, RadioButton, RichTextBox, TabControl, TextBox, TrackBar, TreeView.

To register default size constraints for your control, use the ConstraintsManager.RegisterControlConstraints method, which is declared as follows.

Expanded See Also

Is this topic helpful?​​​​​​​