在运行时更改(系统任务栏应用程序的)“通知"图标的文本 [英] Changing text of Notify icon (of System tray application) at runtime

查看:70
本文介绍了在运行时更改(系统任务栏应用程序的)“通知"图标的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我的项目中对系统托盘应用程序有要求.我的应用程序在队列中有很多文件,这些文件必须复制到另一个位置.每当我将鼠标移到通知图标上时,我需要显示以下详细信息:

应用名称
失败:
成功:
进行中:

谁能帮助我使用C#做到这一点?

谢谢和问候,
YKK Reddy

Hi All,

I have a requirement in my project regarding system tray application. My application has many files in queue which has to be copied on to another location. When ever i move my mouse over the notify icon, i need to show the below details:

App Name
Failed:
Succeeded:
In Progress:

Can anyone help me in acheving this using C#?

Thanks and Regards,
YKK Reddy

推荐答案

在您的主应用程序中,每当状态更改并且需要将其提供给用户使用时,只需更新通知图标的Text属性,然后,当用户将鼠标移到任务栏图标上时,将显示带有文本的工具提示.这与Windows应用程序的行为是一致的,因此不会惹恼用户.

您还可以在状态更改时更改图标.

In your main application, whenever the state changes and you need to make it available to the user, then simply update the Text property of the notify icon, then when the user moves over the icon is the task tray then the tooltip with the text will be displayed. This is consistent behaviour with windows applications and therefore does not annoy the user.

You could also change the icon on a state change.

notifyIcon1.Text = "The New State";
notifyIcon1.Icon = .........; //some icon


我已经使用过Win32可以容纳128个字符的NotifyIcon结构.

请参考提到的链接.
http://stackoverflow.com/questions/579665/how-can-i-show-a-systray-tooltip-longer-than-63-chars [
Ihave used Win32 NotifyIcon structure whichcan hold 128 characters.

Please refer to the mentioned link.
http://stackoverflow.com/questions/579665/how-can-i-show-a-systray-tooltip-longer-than-63-chars[^]


这篇关于在运行时更改(系统任务栏应用程序的)“通知"图标的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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