LayoutControlItem.TextAlignMode Property
Gets or sets the alignment settings of the item’s control.
Namespace: DevExpress.XtraLayout
Assembly: DevExpress.XtraLayout.v24.2.dll
NuGet Package: DevExpress.Win.Navigation
#Declaration
[DefaultValue(TextAlignModeItem.UseParentOptions)]
[DXCategory("Text")]
[XtraSerializableProperty]
public virtual TextAlignModeItem TextAlignMode { get; set; }
#Property Value
Type | Default | Description |
---|---|---|
Text |
Use |
A Text |
Available values:
Name | Description |
---|---|
Use |
Alignment settings are determined by the item’s parent. The item’s Base The item’s immediate parent is a group which provides the Layout For the root group, its parent is the Layout |
Auto |
The auto-size feature is applied to the current layout item. The item’s text region is automatically resized to the minimum width that allows the text to be displayed in its entirety. |
Custom |
Enables custom size mode, in which the size of the layout item’s text region must be specified manually via the Base |
#Remarks
By default, the TextAlignMode property of all layout items is set to TextAlignModeItem.UseParentOptions. In this mode, the alignment settings of the layout items are controlled by the parent group. Since the group’s OptionsItemTextGroup.TextAlignMode property is also set by default to the UseParentOptions value, the alignment settings of layout items are actually controlled by the LayoutControl, as the LayoutControl is the parent of all layout groups. See the LayoutControl’s OptionsItemText.TextAlignMode property to specify the default alignment settings.
Set an item’s TextAlignMode property to any value except for TextAlignModeItem.UseParentOptions to override the parent’s alignment settings for this item. For instance, if the TextAlignMode property is set to TextAlignModeItem.AutoSize the item’s text region is automatically resized to fit the text, while other items, provided that the auto-alignment feature is applied to the group, will be auto-aligned.