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]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]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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. In this mode, Custom Size Constraints are ignored.

Expanded Default Size Constraints

Default size constraints can be customized as follows:

  1. By setting the Control.MinimumSize and Control.MaximumSize properties of embedded controls;
  2. By implementing 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

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