Visual Studio 2015 中的 Notifyicon 缺失

本文关键字:Notifyicon 缺失 中的 2015 Studio Visual | 更新日期: 2023-09-27 17:55:37

我有一个 WPF 应用程序,我正在尝试按照本页中的说明将其发送到通知托盘 http://www.developer.com/net/net/article.php/3336751/C-Tip-Placing-Your-C-Application-in-the-System-Tray.htm

但是我在工具箱中找不到通知图标控件。是否有用于执行此任务的新控件?

Visual Studio 2015 中的 Notifyicon 缺失

NotifyIcon 不像在 Forms 中那样在 WPF 中实现,但您仍然可以使用 Windows Form NofityIcon,它驻留在 System.Windows.Forms namspace 中。

看看这些教程,它们可能会满足您的需求:

简单的解决方案,直接使用通知图标:http://www.abhisheksur.com/2012/08/notifyicon-with-wpf-applications.html

更高级的解决方案,基于NotifyIcon的新库,具有更多功能:http://www.codeproject.com/Articles/36468/WPF-NotifyIcon

有关 NotifyIcon 的更多信息,请访问:http://msdn.microsoft.com/en-us/library/system.windows.forms.notifyicon.aspx