Back to Devexpress

BaseCheckEdit.AutoSizeInLayoutControl Property

windowsforms-devexpress-dot-xtraeditors-dot-basecheckedit-1ffa70fa.md

latest3.1 KB
Original Source

BaseCheckEdit.AutoSizeInLayoutControl Property

Gets or sets whether the editor’s width is changed to display the editor’s content in its entirety. This property is in effect when the editor resides within a LayoutControl.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[Browsable(true)]
[DefaultValue(false)]
[DXCategory("Properties")]
public override bool AutoSizeInLayoutControl { get; set; }
vb
<DXCategory("Properties")>
<Browsable(True)>
<DefaultValue(False)>
Public Overrides Property AutoSizeInLayoutControl As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

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

|

Remarks

When an editor is displayed within a LayoutControl, you can use the AutoSizeInLayoutControl property to enable auto-size mode. In this instance, the editor’s width is changed to display the editor’s text in its entirety.

The layout control allows you to set size constraints for controls, specifying the range in which the control’s size can vary. See the Size and Alignment topic for more information.

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

BaseCheckEdit Class

BaseCheckEdit Members

DevExpress.XtraEditors Namespace