Monday, March 9, 2009

WPF Multiline Textbox

To make a textbox multiline unlike windows forms .Multiline = “True”, in WPF you have to set these 3 properties of TextBox Control.

  1. TextWrapping="Wrap"
  2. VerticalScrollBarVisibility="Visible"
  3. AcceptsReturn="True"

e.g.

<TextBox Height="66" Margin="563,46,265,0" Name="textBox1" VerticalAlignment="Top" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible"/>

14 comments:

Unknown said...

thanks this is working.
thnks for the help

Housemouse said...

thanks for this tutorial

Unknown said...

Excellent solution, thanks very much! I like the nice concise format, no need to filter through 5 paragraphs to get the same information. THANKS!

naish said...

Good One. And best part is, it is working. Thanks

Unknown said...
This comment has been removed by the author.
SAMH said...

Thanks...also would you help me to 'Get entered text of a RichTextBox in WPF.

Armen said...

i thought life is over, because i can not find out problem's solution, and suddenly i come here, and wander.............

thankssssssssssssssssssss

mauri said...

Thanks, thanks, thanks!!!

sasankasaisekhar said...

Thanks alot.. Its working..

Fer_Show said...

Woow how did you know... Increible carnalito, vientos man !

kayrk said...

You can leave the verticalscrollbar visibility to Auto also by the way doesn't have to be set to Visible.

Unknown said...

Thanx a lot... :)

Volker said...

Short and good, thanks!

Anonymous said...

Customizing text lines of paragraph in RichTextBox