2011-10-31 49 views
0

我是textBox中的关键字,但是新行不会。我需要什么。文本框中的新行

是否有解决方案?

+0

为什么你需要吗? – sll

+0

在文本框中按下并转到新行。 – mrJack

+0

@sll:我需要多行文本框 – mrJack

回答

1
<TextBox 
    Name="tbMultiLine" 
    TextWrapping="Wrap" 
    AcceptsReturn="True" 
    VerticalScrollBarVisibility="Visible" 
> 
    This TextBox will allow the user to enter multiple lines of text. When the RETURN key is pressed, 
    or when typed text reaches the edge of the text box, a new line is automatically inserted. 
</TextBox 

How to: Create a Multiline TextBox Control

1

使用文本块,并设置您的XAML以下参数:

<TextBox name="textBox1" 
    TextWrapping="Wrap" 
    VerticalScrollBarVisibility="Visible" 
    AcceptsReturn="true"/>