OnPreviewTextInput 并不总是提供文本
我们正在尝试用新的 WPF 应用程序替换现有的应用程序。
我们在遗留应用程序中使用的控件之一具有特殊的行为,其中该控件重定向用户输入的任何文本以在外部进行处理。之后,结果以编程方式更新回控件中。 (该控件的行为与只读 TextBox
类似,因为不允许用户直接在控件中编辑文本;用户键入的任何文本在显示在控件中之前都会被重定向
)使用 OnPreviewTextInput
事件重定向 e.Text
并将事件标记为 e.Handled
。这适用于英语输入以及 Microsoft 日语 IME。但是,当我们尝试使用 Microsoft 韩语 IME 时,e.Text
显示为空字符串...
您是否想过为什么它适用于日语,但不适用于韩语?
We have an existing application we are trying to replace with a new WPF application.
One of the controls we use in the legacy application has a specialized behavior where the control redirects any text input by the user to be processed externally. After which the result is updated programmatically back into the control. (the control behaves similarly to a read-only TextBox
in that the user is not allowed edit text directly in the control; any text the user types is redirected before it is shown in the control)
We settled on using the OnPreviewTextInput
event to redirect e.Text
and mark the event as e.Handled
. This worked using English input as well as the Microsoft Japanese IME. But when we tried using the Microsoft Korean IME, e.Text
comes through as an empty string...
Any thoughts on why it would work for Japanese, but not for Korean?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论