系统托盘应用程序 [英] System Tray Applications

查看:111
本文介绍了系统托盘应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果这是重复的,我很抱歉,因为我无法找到我今天制作的原始帖子



无论如何。 。


现在轮到我问一个问题


我想开发一个可以在系统托盘中运行的应用程序。我该怎么办?

这个?

问候OHM

If this is duplicated, I''m sorry because I cant find the original post I
made today

Anyway . .

Now its my turn to ask a question

I want to develop an app which will run in the system tray. How can I do
this?
Regards OHM

推荐答案

" One Handed Man [OHM]

< te *************************** @ BTOpenworld.com> schrieb
"One Handed Man [ OHM ]"
<te***************************@BTOpenworld.com> schrieb
如果这是重复的,我很抱歉,因为我无法找到我今天发布的原始帖子

无论如何。 。

现在轮到我问一个问题

我想开发一个可以在系统托盘中运行的应用程序。我怎么能这样做?
If this is duplicated, I''m sorry because I cant find the original
post I made today

Anyway . .

Now its my turn to ask a question

I want to develop an app which will run in the system tray. How can I
do this?




系统托盘中没有太多空间,因此您的应用可能会受到伤害。 ;-))

使用NotifyIcon组件(System.Windows.Forms.NotifyIcon)

-

Armin



There is not much space in the system tray, so your app might get hurt. ;-))
Use the NotifyIcon component (System.Windows.Forms.NotifyIcon)
--
Armin


OHM,

Matthew MacDonald的书Microsoft Visual Basic .NET Programmer's Cookbook

有一个关于创建系统托盘程序的主题。


基本上:不是使用Form作为启动对象,而是使用Component

代替。


创建一个新的Component类(使用Project - Add Component)。将NotifyIcon

添加到组件设计器。还要为

NotifyIcon添加一个ContextMenu对象。单击菜单时,创建并显示表单。记得

在菜单上放置一个退出选项。


使组件成为启动对象,将一个共享子主体添加到

组件。


公共类组件1

继承System.ComponentModel.Component


''生成组件设计器代码省略。


Public Shared Sub Main

将应用程序视为新组件1

Application.Run()

End Sub


Private Sub menuOptions_Click(...)Handles menuOptions.Click

Dim dialog as New OptionsDialog

dialog.ShowDialog()

dialog.Dispose()

End Sub


Private Sub menuExit_Click(...)Handle menuExit .Click

Application.Exit()

结束子


结束子


问题是您无法从组件设计器编辑菜单。你

可以使用cut&从表单粘贴以获取菜单到组件...


希望这有帮助

Jay


一手人[OHM] < te *************************** @ BTOpenworld.com>

在留言新闻中写道:e% **************** @ TK2MSFTNGP12.phx.gbl ...
OHM,
Matthew MacDonald''s book "Microsoft Visual Basic .NET Programmer''s Cookbook"
has a topic on creating a system tray program.

Basically: Rather than using a Form as the startup object, use a Component
instead.

Create a new Component class (use Project - Add Component). Add a NotifyIcon
to the component designer. Also add a ContextMenu object for the
NotifyIcon. When you click the menu, create and show the form. Remember to
put an Exit option on the menu.

Make the Component the startup object, adding a Shared Sub Main to the
component.

Public Class Component1
Inherits System.ComponentModel.Component

'' Component designer generated code omitted.

Public Shared Sub Main
Dim app as New Component1
Application.Run()
End Sub

Private Sub menuOptions_Click(...) Handles menuOptions.Click
Dim dialog as New OptionsDialog
dialog.ShowDialog()
dialog.Dispose()
End Sub

Private Sub menuExit_Click(...) Handles menuExit.Click
Application.Exit()
End Sub

End Sub

The problem is you cannot edit the menu from the Component Designer. You
can use cut & paste from a form to get the menu to the component...

Hope this helps
Jay

"One Handed Man [ OHM ]" <te***************************@BTOpenworld.com>
wrote in message news:e%****************@TK2MSFTNGP12.phx.gbl...
如果这是重复的,我很抱歉,因为我找不到原帖我今天做了

无论如何。 。

现在轮到我问一个问题

我想开发一个可以在系统托盘中运行的应用程序。我怎么能这样做?

问候OHM
If this is duplicated, I''m sorry because I cant find the original post I
made today

Anyway . .

Now its my turn to ask a question

I want to develop an app which will run in the system tray. How can I do
this?
Regards OHM





Armin Zingler < AZ ******* @ freenet.de>在消息中写道

news:OT ************** @ TK2MSFTNGP12.phx.gbl ...

"Armin Zingler" <az*******@freenet.de> wrote in message
news:OT**************@TK2MSFTNGP12.phx.gbl...
" One Handed Man [OHM]"
< te *************************** @ BTOpenworld.com> schrieb
"One Handed Man [ OHM ]"
<te***************************@BTOpenworld.com> schrieb
如果这是重复的,我很抱歉,因为我无法找到我今天发布的原始帖子

无论如何。 。

现在轮到我问一个问题

我想开发一个可以在系统托盘中运行的应用程序。我怎么能这样做?
系统托盘中没有太多空间,因此您的应用可能会受到伤害。
If this is duplicated, I''m sorry because I cant find the original
post I made today

Anyway . .

Now its my turn to ask a question

I want to develop an app which will run in the system tray. How can I
do this?
There is not much space in the system tray, so your app might get hurt.



; - ))


*叹气* ...我知道你并不只是说....

使用NotifyIcon组件(System.Windows.Forms.NotifyIcon)

-
Armin


;-))

*sigh*... I know you didn''t just say that....
Use the NotifyIcon component (System.Windows.Forms.NotifyIcon)
--
Armin



这篇关于系统托盘应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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