#929 – Allowing Multiline Input in a TextBox

You can configure a TextBox to automatically wrap lines of text to multiple lines by setting the TextWrapping property to Wrap or WrapWithOverflow.  You can visually show that a TextBox has more lines than currently fit into the visible region of the TextBox by setting the VerticalScrollBarVisibility property to Auto or Visible.

With these properties set, the text that a user enters into the TextBox will automatically wrap when the user reaches the edge of the TextBox.


If you also want the user to be able to press Enter or Return to move to a new line, you can set the AcceptsReturn property to true.

        <TextBox Grid.Row="1" Margin="5"

With both TextWrapping set to Wrap and AcceptsReturn set to true, text will wrap to the next line if the edge of the TextBox is reached or if the user presses Enter.



About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #929 – Allowing Multiline Input in a TextBox

  1. Pingback: Dew Drop – October 16, 2013 (1,646) | Morning Dew

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: