TextBox.HorizontalTextAlignment TextBox.HorizontalTextAlignment TextBox.HorizontalTextAlignment TextBox.HorizontalTextAlignment Property


Gets or sets a value that indicates how text is aligned in the TextBox.

public : TextAlignment HorizontalTextAlignment { get; set; }
TextAlignment HorizontalTextAlignment();

void HorizontalTextAlignment(TextAlignment horizontaltextalignment);
public TextAlignment HorizontalTextAlignment { get; set; }
Public ReadWrite Property HorizontalTextAlignment As TextAlignment
<TextBox HorizontalTextAlignment="textAlignmentValue"/>

Property Value

One of the TextAlignment enumeration values that specifies how text is aligned. The default is Left.

Additional features and requirements

Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)


This property provides the same functionality as the TextAlignment property. If both properties are set to conflicting values, the last one set is used.

Apps that target the Fall Creators Update (SDK 16299) or later should use this property instead of TextAlignment. If your app also supports previous versions, see Version adaptive apps: Use new APIs while maintaining compatibility with previous versions for more info.