Back to Devexpress

BaseControl.AutoSizeInLayoutControl Property

windowsforms-devexpress-dot-xtraeditors-dot-basecontrol-12661ec1.md

latest3.2 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Properties")]
[Browsable(false)]
public virtual bool AutoSizeInLayoutControl { get; set; }
vb
<DXCategory("Properties")>
<Browsable(False)>
Public Overridable Property AutoSizeInLayoutControl As Boolean

Property Value

TypeDescription
Boolean

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

|

Remarks

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

See Size and Alignment to learn more.

Example

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.

csharp
using DevExpress.XtraLayout;

checkEdit1.AutoSizeInLayoutControl = true;
layoutControlItem2.SizeConstraintsType = SizeConstraintsType.SupportHorzAlignment;
layoutControlItem2.ContentHorzAlignment = DevExpress.Utils.HorzAlignment.Center;
vb
Imports DevExpress.XtraLayout

checkEdit1.AutoSizeInLayoutControl = True
layoutControlItem2.SizeConstraintsType = SizeConstraintsType.SupportHorzAlignment
layoutControlItem2.ContentHorzAlignment = DevExpress.Utils.HorzAlignment.Center

See the following help topic for more information: Size and Alignment.

See Also

AutoWidthInLayoutControl

Size and Alignment

BaseControl Class

BaseControl Members

DevExpress.XtraEditors Namespace