属性停靠窗口上的 MFC 按键被捕获为其他控件加速器
我有一个 Visual C++ 应用程序,其中主框架中有一个 CListCtrl 以及一个带有属性窗口的可停靠窗格。
当我按下“属性”窗口上的“删除”键时,应用程序也将其理解为 CListCtrl 的“删除所选项目”。
其他键也会出现一些类似的行为。
我怎么能说我不希望它也进入 CListCtrl 呢?
I have a Visual C++ application where there are, among other things, a CListCtrl in the Main Frame and a Dockable Pane with a properties Window.
When I press the Delete key on the Properties Window, the application also understands it as "Delete selected item" of the CListCtrl.
Some similar behaviours occur for other keys.
How can I say that I don't want this to go also to the CListCtrl?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我在Mainframe类中做了一个PreTranslateMessage函数,当输入来自Properties Control或其后代时,将HACCCEL当前加速器表放入临时变量中,然后调用父类PreTranslateMessage,最后重新获取原始加速器表在此函数的末尾。
现在,我有另一个问题:这是最好的解决方案吗?在我看来不是这样的!
Ok, I made a PreTranslateMessage function in the Mainframe class, that puts the HACCCEL current accelerator table in a temporary variable when the input comes from the Properties Control or a descendent of it, then call the parent class PreTranslateMessage, and finally retake the original accelerator table in the end of this function.
Now, I have another question: Is this the best solution? Doesn't seem to me it is!