在WPF窗口中未触发ShortCut密钥 [英] ShortCut key not fired in WPF window

查看:98
本文介绍了在WPF窗口中未触发ShortCut密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

请给我以下问题的解决方案.

在父子窗口中使用了添加"选项.同时为两个按钮设置相同的快捷键(Alt + a).我有一个问题子窗口处于活动状态时,父窗口中的快捷键事件起作用".但我想要以下解决方案. 当父窗口处于活动状态时,快捷键事件在父窗口中起作用;当子窗口处于活动状态时,快捷键事件也在子窗口中起作用"

预先感谢,
MahaLakshmi S.

Dear Friends,

Please give me solution for below Question.

Have used "add" option in parent and child window. Also set the same shortcut key(Alt+a) for both buttons. I have a problem " shortcut key event work in parent window when child window is active". but I want the following solution. "shortcut key event work in parent window when parent window is active and also shortcut key event work in child window when child window is active"

Thanks in advance,
MahaLakshmi S.

推荐答案

您是否已检查子Form的KeyPreview属性?将KeyPreview属性设置为True.现在,您的快捷键将必须工作.让我知道它是否无法解决.
Have you checked the KeyPreview property of child Form? Set KeyPreview property to True. And Now your shortcut key will have to work. Let me know if it is not work out.


这篇关于在WPF窗口中未触发ShortCut密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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