Skip to main content
A newer version of this page is available. .

How to: Enable the Auto-Size Feature for a CheckEdit and Align It Horizontally

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.

LayoutControl_CheckEdit_AlignHorz

using DevExpress.XtraLayout;

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