TextAlignment TextAlignment TextAlignment TextAlignment Enum


Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Prerelease APIs are identified by a Prerelease label.

[Contains prerelease APIs.]
Specifies whether text is centered, left-aligned, or right-aligned.

public : enum class TextAlignmentpublic enum TextAlignmentPublic Enum TextAlignment// This API is not available in Javascript.
<object property="textAlignmentMemberName"/>
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


DetectFromContent is available starting with Windows 10. 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.


Center Center Center Center

Text is centered within the container.

DetectFromContent DetectFromContent DetectFromContent DetectFromContent

Text alignment is inferred from the text content.

End End End End

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

Justify Justify Justify Justify

Text is justified within the container.

Left Left Left Left

Text is aligned to the left edge of the container.

Right Right Right Right

Text is aligned to the right edge of the container.

Start Start Start Start

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

See Also