如何运行"空" Windows应用程序,只有一个NotifyIcon的? [英] How to run an "empty" Windows Application that only has a NotifyIcon?
问题描述
我想打,只有拥有的NotifyIcon的应用。它并不需要有在所有一个主形式。当我想要实现这样的事情,我只是创建一个无形的形式,并运行它,但会有这样做的更加优雅的方式,我想知道这一点。
I want to make an Application that only has a NotifyIcon. It doesn't need to have at all a "Main" Form. When I want to achieve something like this, I just create an invisible form and run it, but would there be a more "elegant" way of doing this, I'd like to know it.
你怎么一般做到这一点?此应用程序不能是Windows服务,为具有的NotifyIcon和上下文菜单是很重要的(他们每个人将运行不同的命令)。
How do you generally do this? This application can't be a Windows Service, as having the NotifyIcon and its Context Menus is important (each one of them will run a different command).
感谢
推荐答案
检查出的这个博客帖子:
由于原来它是那么容易的它是可笑的。所有你需要做的创建一个类,是继承的IContainer接口。当您创建的通知图标的情况下,通过一个容器对象。
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.
它给你的通知图标,而不是一个上下文菜单
It gives you the notify icon, but not a context menu.
这篇关于如何运行"空" Windows应用程序,只有一个NotifyIcon的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!