开发者

c# - Tray Icon not showing

开发者 https://www.devze.com 2023-01-15 16:55 出处:网络
I have a NotifyIcon set up on my main form, however when the form ran the notification icon doesn\'t appear?

I have a NotifyIcon set up on my main form, however when the form ran the notification icon doesn't appear?

I have it's visible attribute set to true and if I try to show a balloon tooltip:

ntiTrayIcon.ShowBalloonTip(1000, "Info:", "Double click this icon to close AlwaysOnTop", ToolTipIcon.Info);

That doesn't show either.

What's the problem?

Some Info on the form: It's a SizeableToolWindow and it has no control box or caption (so it shows up as just the borders) and it gets hidden after a while (it's essentially a splash screen that regi开发者_开发知识库sters some global keyboard hooks), would this be the problem?


Try to add this line in your form constructor

trayIcon.Icon = new Icon(SystemIcons.Application, 40, 40);
0

精彩评论

暂无评论...
验证码 换一张
取 消