TextBox.TextWrapping TextBox.TextWrapping TextBox.TextWrapping TextBox.TextWrapping Property

定义

获取或设置文本框中文本的换行方式。Gets or sets how the text box should wrap text.

public:
 property System::Windows::TextWrapping TextWrapping { System::Windows::TextWrapping get(); void set(System::Windows::TextWrapping value); };
public System.Windows.TextWrapping TextWrapping { get; set; }
member this.TextWrapping : System.Windows.TextWrapping with get, set
Public Property TextWrapping As TextWrapping

属性值

指定文本框中文本换行方式的其中一个 TextWrapping 值。One of the TextWrapping values that indicates how the text box should wrap text. 默认值为 NoWrapThe default is NoWrap.

示例

下面的示例演示如何设置此属性的值。The following example demonstrates how to set the value of this property.

private void wrapOff(object sender, RoutedEventArgs e)
{
    myTextBox.TextWrapping = TextWrapping.NoWrap;
}
Private Sub wrapOff(ByVal sender As Object, ByVal e As RoutedEventArgs)
    myTextBox.TextWrapping = TextWrapping.NoWrap
End Sub

注解

如果将Wrap TextBox属性设置为, 则在TextBox到达控件边缘时将输入的文本换行到新行, 如有必要, 将自动扩展控件的高度以包含新行的空间。 TextWrappingSetting the TextWrapping attribute to Wrap causes entered text to wrap to a new line when the edge of the TextBox control is reached, automatically expanding the height of the TextBox control to include room for a new line, if necessary.

依赖项属性信息Dependency Property Information

标识符字段Identifier field TextWrappingProperty
元数据属性设置为trueMetadata properties set to true AffectsMeasureAffectsRenderAffectsMeasure, AffectsRender

适用于