In WPF textBox, enter does not add a new line

Ivan picture Ivan · Jul 26, 2011 · Viewed 28.9k times · Source

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?

Answer

VilemRousi picture VilemRousi · Apr 15, 2012

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