如何在Windows Phone 8应用程序的文本框中启用滚动? [英] How to enable scrolling in textbox for windows phone 8 app?

查看:52
本文介绍了如何在Windows Phone 8应用程序的文本框中启用滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在文本框中滚动内容..

I want to scroll content inside my textbox..

怎么做?

是否有任何选项可以设置最大值文本框的行?

is there any option to set maximum lines for textbox?

推荐答案

一个简单的解决方案是将TextBox放在ScrollViewer中,例如:

One simple solution is to put the TextBox inside a ScrollViewer, ex:

<ScrollViewer Height="200">
    <TextBox x:Name="textBox1" Text="foo" AcceptsReturn="True" TextWrapping="Wrap"/>
</ScrollViewer>




警告:控件的渲染大小限制在2000像素左右,因此这适用于中等量的文本但不适用于非常大的文本块。


Caveat: The render size of controls is limited to around 2000 pixels so this will work for medium amount of text but won't work for very large blocks of text.


这篇关于如何在Windows Phone 8应用程序的文本框中启用滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆