kaywang 发表于 2015-5-12 12:05:37

Multiline textbox in Windows Phone 7

Multiline textbox in Windows Phone 7

  JANUARY 10, 2011 BY NAGA HARISH MOVVA 2 COMMENTS









Rate This  
  
In this post I am going to explain about Textarea(Multiline) in windows phone 7 (wp7). We did not have textarea control, but we can create textarea with Textbox itself. Even for textbox there is no property called Mutiline=”True”. It is easy to do check it..
  In Silverlight for Windows Phone didn’t have textarea control. So, we need to use same Textbox as a textarea by changing few properties like AcceptsReturn value to True (AcceptsReturn=”True”), to allow enter key in the textbox. we can see TextWrapping property for wrap the text automatically (TextWrapping=”Wrap”). So, the overflow text will just shown in separateline. Re-commanded : to get Textarea look we need to set the height , for example height=”160″, see this XAML code
  
  in this below image, first I used just TextWrapping=”Wrap” with height, so if I type more set in that it will align in new lines.
  But in second, I used AcceptsReturn=”True” with height. I can just type few words and press enter it will moveto new line.
  Check with this image

Multiline textbox in windows phone 7 (WP7)
  设置AcceptsReturn 属性,按回车自动换行。
  设置TextWrapping 属性,只有输入到边界的时候才能换行,不具备按回车自动换行的功能
  See more Windows Phone 7 posts here
  Enjoy while coding..!
  Thanks,
  Naga Harish.


[*]Share this:
[*]Facebook
[*]Twitter
[*]Reddit
[*]Digg
[*]Share
[*]




  FILED UNDER WINDOWS PHONE 7 DEVELOPER TAGGED WITH WINDOWS PHONE 7, WP7

About Naga Harish Movva
页: [1]
查看完整版本: Multiline textbox in Windows Phone 7