TextAlignment Enum

Definition

Specifies whether text is centered, left-aligned, or right-aligned.

C#
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
public enum TextAlignment
XAML
<object property="textAlignmentMemberName"/>
Inheritance
TextAlignment
Attributes

Fields

Name Value Description
Center 0

Text is centered within the container.

Left 1

Text is aligned to the left edge of the container.

Start 1

The beginning of the text is aligned to the edge of the container.

End 2

The end of the text is aligned to the edge of the container.

Right 2

Text is aligned to the right edge of the container.

Justify 3

Text is justified within the container.

DetectFromContent 4

Text alignment is inferred from the text content.

Remarks

When the TextAlignment property is set to DetectFromContent, alignment is inferred from the text content of the control. For example, English text is left aligned, and Arabic text is right aligned.

Applies to

Product Versions
Windows App SDK 0.8, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6

See also