在Win Forms NotifyIcon上禁用Alt-F4 [英] Disabling Alt-F4 on a Win Forms NotifyIcon

查看:111
本文介绍了在Win Forms NotifyIcon上禁用Alt-F4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Win Forms中的NotifyIcon为WPF C#应用程序制作系统托盘图标.

I am using a NotifyIcon from Win Forms to make a systray icon for my WPF C# application.

我有一个错误,即如果用户右键单击上下文菜单的图标,他们可以按Alt-F4键,该图标将从托盘中消失,但是Main WPF应用程序仍在运行.当他们已最小化到系统托盘"并且对应用程序的唯一控制权现在消失了时,这尤其是一个问题.

I have a bug where if the user right clicks the icon for the context menu, they can press Alt-F4 and the icon will disappear from the tray, but the Main WPF application is still running. This is especially a problem when they have "minimized to systray" and the only control of the application is now gone.

有人知道如何在系统托盘上专门处理此问题吗?我查看了NotifyIcon文档,没有与按键事件有关的任何信息.

Anyone know how to handle this specificially on the systray? I've looked at the NotifyIcon documentation and there isn't anything relating to keypress events.

更新:这是一个示例应用程序,用于显示我如何使用系统托盘和实际错误. http://cid-e75a75f75a1fbfbb5.office .live.com/self.aspx/.Public/WpfApplication1.zip?sa = 221089565

UPDATE: here's a sample application to show how I'm using the systray and the actual bug. http://cid-e75a75f1a1fbfbb5.office.live.com/self.aspx/.Public/WpfApplication1.zip?sa=221089565

推荐答案

所以这是一个错误,我已经将其报告给Microsoft Connect.在此处查看我认为的更新:

So this is a bug and I've reported it to Microsoft Connect. Check here for updates I suppose: https://connect.microsoft.com/VisualStudio/feedback/details/568590/unable-to-disable-alt-f4-on-winforms-notifyicon-when-context-menu-is-open?wa=wsignin1.0

这篇关于在Win Forms NotifyIcon上禁用Alt-F4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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