TextBox.HorizontalTextAlignment 属性

定义

获取或设置一个值,该值指示文本在 TextBox 中的对齐方式。

public:
 property TextAlignment HorizontalTextAlignment { TextAlignment get(); void set(TextAlignment value); };
TextAlignment HorizontalTextAlignment();

void HorizontalTextAlignment(TextAlignment value);
public TextAlignment HorizontalTextAlignment { get; set; }
var textAlignment = textBox.horizontalTextAlignment;
textBox.horizontalTextAlignment = textAlignment;
Public Property HorizontalTextAlignment As TextAlignment
<TextBox HorizontalTextAlignment="textAlignmentValue"/>

属性值

指定文本对齐方式的 TextAlignment 枚举值之一。 默认值为 Left

注解

此属性提供与 TextAlignment 属性相同的功能。 如果两个属性都设置为冲突值,则使用最后一个属性集。

面向 Fall Creators Update (SDK 16299) 或更高版本的应用应使用此属性,而不是 TextAlignment。 如果应用还支持以前的版本,请参阅 版本自适应应用:在保持与以前版本的兼容性的同时使用新 API ,了解详细信息。

适用于