WPF Richtextbox 和键盘快捷键
我正在为德国用户实现一个带有 Richtextbox 的 WPF 应用程序。他们想要使用“普通”键盘快捷键来执行一些基本格式设置:粗体、斜体、下划线。
在英语中,快捷键 CTRL+B、CTRL+I 和 CTRL +U 正在 Richtextbox 中工作。
然而,“正常”的德语快捷键是 CTRL+SHIFT+F (Fett = Bold)、CTRL+< kbd>SHIFT+K(Kursiv = 斜体)和 CTRL+SHIFT+U(对于强调)。在德语 Windows 计算机 (Windows 7) 上运行 WPF (.net 4.0) 应用程序时,Richttextbox 对这些快捷方式没有反应,并且“英语”快捷方式也不起作用。只有 CTRL+SHIFT+F 正在做某事,但它是错误的:它使所选文本变为斜体,而不是粗体。
关于如何解决这个问题有什么建议吗?有没有办法为 RichTextBox 显式定义快捷方式映射?还有其他建议吗?这是一个错误吗?
亲切的问候,
罗比·德·萨特
I'm implementing a WPF application with a richtextbox for German users. They want to use their "normal" keyboard shortcuts to do some basic formatting: bold, italic, underline.
In English, the shortcuts CTRL+B, CTRL+I, and CTRL+U are working in the Richtextbox.
However the "normal" German shortcuts are CTRL+SHIFT+F (Fett = Bold), CTRL+SHIFT+K (Kursiv = Italic) and CTRL+SHIFT+U (for Underline). When running the WPF (.net 4.0) application on a German Windows machine (Windows 7), the Richttextbox is not reacting to these shortcuts and also the "English" shortcuts are not working. Only CTRL+SHIFT+F is doing something, but does it wrong: it makes the selected text Italic, not Bold.
Any suggestions on how to fix this? Is there a way to define the shortcut mappings explicitly for the RichTextBox? Any other suggestions? Is this a bug?
Kind regards,
Robbie De Sutter
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您可以禁用您不想允许的命令绑定:
然后您可以使用如下所示的内容为您想要允许的内容创建自定义命令绑定: http://www.switchonthecode.com/tutorials/wpf-tutorial-command-bindings-and-custom-commands
I think you can disable command binding you don't want to allow with:
You could then create custom command bindings for what you want to allow using something like what is shown here: http://www.switchonthecode.com/tutorials/wpf-tutorial-command-bindings-and-custom-commands