The WPF TextBox can be multi line, accept enter, display wrapping, etc. All you need is something like...
<TextBox VerticalAlignment="Stretch"
TextWrapping="WrapWithOverflow" Text="{Binding Message}" ScrollViewer.CanContentScroll="True"
AcceptsReturn="True"/>
This may be because you have set a height. If you set a height, VerticalAlignment=Stretch is ignored. In my case, I had a default style that included a height. One way to fix this is to assign an empty style...
<TextBox VerticalAlignment="Stretch" TextWrapping="WrapWithOverflow" Text="{Binding Message}" ScrollViewer.CanContentScroll="True" AcceptsReturn="True">
<Style TargetType="TextBox"/>
<TextBox.Style>
No comments:
Post a Comment