Reputation: 2184
I have a simple WPF application with an empty TextBox. I would like the user to be able to copy rows of text (from one column) in Excel and paste the contents into the TextBox. My app will then format the text in a certain way.
When I paste the copied rows, the TextBox only contains the first row.
When I paste into Notepad all the items are pasted correctly.
How can I get the same effect in my WPF app?
I have tried changing TextWrapping
to NoWrap
, Wrap
, WrapWithOverflow
. MaxLines
is set to 2147483647. I don’t see any other Properties that make sense to change.
Upvotes: 0
Views: 712
Reputation: 169170
It should work if you set the AcceptsReturn
property of the TextBox
to true
:
<TextBox AcceptsReturn="True" Height="100" />
Upvotes: 1