TextBox.TextWrapping 屬性

定義

取得或設定文字方塊如何包圍文字。

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 值,表示文字方塊應該如何包圍文字。 預設為 NoWrap

範例

下列範例示範如何設定此屬性的值。

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

備註

TextWrapping將 屬性設定為 Wrap 會讓輸入的文字在到達控制項邊緣 TextBox 時換行到新行,並視需要自動展開控制項的高度 TextBox 以包含新行的空間。

相依性屬性資訊

識別碼欄位 TextWrappingProperty
中繼資料屬性設定為 true AffectsMeasure, AffectsRender

適用於