自动调整覆盖长多个文本框 WP8 [英] Autosize for cover long multiple textbox WP8
本文介绍了自动调整覆盖长多个文本框 WP8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚在 xaml 中创建了文本框.它可能被很长的文字填满.
I just created textbox in xaml. It is probably filled by very long text.
<TextBox x:Name="txtStory" Grid.Row="1" Grid.Column="1" MinWidth="456" MinHeight="200" TextWrapping="Wrap" Foreground="Black" AcceptsReturn="True" VerticalScrollBarVisibility="Visible"/>
我的问题是当我输入多行时,它会像这样裁剪
My problem is when i type in multiple line, it will cropped like this
我应该怎么做才能使用滚动或其他我可以使用的方法制作文本框?谢谢
What should i do to make textbox with scrolling or another method that i can use? Thank you
推荐答案
您必须设置 ScrollViewer 的最大高度,并且可以将 Scrollbars 的 Visibility 设置为 Auto.
You have to set the maximum height of the ScrollViewer and could set the Visibility for the Scrollbars to Auto.
<ScrollViewer Height="200" VerticalScrollBarVisibility="Auto">
<TextBox x:Name="txtStory" VerticalAlignment="Top" TextWrapping="Wrap" Height="Auto" HorizontalAlignment="Left" Text="TextBox" Width="460">
</TextBox>
</ScrollViewer>
在上面的例子中,你可以根据需要设置 ScrollViewer 的高度
in above example you could set ScrollViewer height according to your need
这篇关于自动调整覆盖长多个文本框 WP8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文