A newer version of this page is available. Switch to the current version.

BaseControl.AutoSizeInLayoutControl Property

When a control is added to a LayoutControl, this property specifies whether the control's width is changed to display its content in its entirety. This member is supported by individual descendant of the BaseControl class.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v19.2.dll


public virtual bool AutoSizeInLayoutControl { get; set; }

Property Value

Type Description

true if auto-size mode is enabled; otherwise, false.


Not all descendants of the BaseControl class support the auto-size feature within a LayoutControl.

See Aligning Controls Within Layout Items to learn more.


The following code shows how to enable the auto-size feature for a CheckEdit within a LayoutControl, and center the CheckEdit within the corresponding layout item.


using DevExpress.XtraLayout;

checkEdit1.AutoSizeInLayoutControl = true;
layoutControlItem2.SizeConstraintsType = SizeConstraintsType.SupportHorzAlignment;
layoutControlItem2.ContentHorzAlignment = DevExpress.Utils.HorzAlignment.Center;
See Also