系统相关
首页 > 系统相关> > c# – 如何运行只有NotifyIcon的“空”Windows应用程序?

c# – 如何运行只有NotifyIcon的“空”Windows应用程序?

作者:互联网

我想创建一个只有NotifyIcon的应用程序.它根本不需要具有“主要”形式.当我想要实现这样的东西时,我只是创建一个不可见的形式并运行它,但是会有更“优雅”的方式来做到这一点,我想知道它.

你一般这样做吗?此应用程序不能是Windows服务,因为具有NotifyIcon及其上下文菜单很重要(它们中的每一个都将运行不同的命令).

谢谢

解决方法:

查看this blog post

As it turned out it was so easy it was ridiculous. All you have to do create a class that is inherits the iContainer interface. When you create the instance of the notify icon, pass a container object.

它为您提供通知图标,但不提供上下文菜单.

标签:c,net,vb-net,notifyicon
来源: https://codeday.me/bug/20190627/1300044.html