在WPF textBox中,回车不添加新行 [英] In WPF textBox, enter does not add a new line

查看:22
本文介绍了在WPF textBox中,回车不添加新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文本框在以下代码中定义:

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?

推荐答案

我遇到了类似的问题,我使用 AcceptsReturn="True 用 this question 解决了它".所以我认为,这应该可行.

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

这篇关于在WPF textBox中,回车不添加新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆