(X) Hide this
    • Login
    • Join
      • Generate New Image
        By clicking 'Register' you accept the terms of use .
        Login with Facebook

Tip: How to make a text box multi line?

(5 votes)
Denislav Savkov
>
Denislav Savkov
Joined Feb 11, 2008
Articles:   14
Comments:   6
More Articles
5 comments   /   posted on Sep 04, 2008
Categories:   Controls

Text box control in Silverlight supports multi line mode but surprisingly it does not have such property as Multyline. That is why, in order to make one text box multi line, you have to set its property AcceptsReturn to true.

Xaml

<TextBox x:Name="textBox" AcceptsReturn="True"></TextBox>

C#

TextBox textBox = new TextBox();
textBox.AcceptsReturn = true;

That's it!


Subscribe

Comments

  • -_-

    RE: Tip: How to make a text box multi line?


    posted by rams on Aug 17, 2010 13:39
    <asp:textbox id="textbox" textmode="multiline" runat="server"></asp:textbox>
  • -_-

    RE: Tip: How to make a text box multi line?


    posted by swazz on Oct 21, 2010 23:09
    Thanks! This is what I was looking for!
  • -_-

    RE: Tip: How to make a text box multi line?


    posted by mishu on Nov 30, 2010 21:38
    thanks
  • -_-

    RE: Tip: How to make a text box multi line?


    posted by -cb- on Dec 15, 2010 20:10
    Excellent! Thanks for posting this!
  • iiordanov

    Re: Tip: How to make a text box multi line?


    posted by iiordanov on Jun 03, 2011 18:29

    This post was originally posted by Thank you

     

    As was mentioned on Stackoverflow don't forget to assign TextWrapping property. Make it Wrap from NoWrap.

    In this case, it will work.

     

Add Comment

Login to comment:
  *      *       
Login with Facebook