Multiline Textbox in Windows Phone 7

How to add multiline textbox or text area in windows mobile 7?

Unike ASP.NET in Windows Mobile 7(silverlight) there is no property for the textbox like Multiline=”true” but we can create textarea with Textbox itself.

We can use Textbox as a textarea by changing few properties like AcceptsReturn value to True (AcceptsReturn=”True”), to allow enter in the textbox. we can see TextWrapping property for wrap the text automatically (TextWrapping=”Wrap”). So, the overflow text will just shown in separate line.
To get Textarea look we need to set the height , for example height=”170″, see this XAML code


<TextBox x:Name="txtBoxMultiLine"  AcceptsReturn="True" Height="160" 
TextWrapping="Wrap" />


About the Author: Bhanu Slathia

1 Comment + Add Comment

  • thanks for this, i was kind of stack wth this problem

Leave a comment