In WPF textBox, enter does not add a new line

Viewed 33693

Text box is defined in following code:

<TextBox Grid.Row="2" IsReadOnly="{Binding IsDescriptionReadOnly}" AcceptsReturn="True"
                                 TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" Text="{Binding Description, UpdateSourceTrigger=PropertyChanged}"/>e

When enter is pressed, a new line is not inserted. How to fix this problem?

3 Answers

I had similar problem, I solved it with this question using AcceptsReturn="True". So I think, this should work.

Add the following:

TextBox.AcceptsReturn = True;
Related